I'm trying to make a sudoku solver, using reactjs as an exercise to learn reactjs. Each square on the grid, may contain either a single number('filled'), or up to 9 'notes' indicating what numbers may fit there.
The problem is that when a filled square is beside a notes square, the notes squares seem to shift downwards such that the first line of the notes' baseline is aligned with that of a digit in the filled square. I want the squares to stay put in relation to one another, ignoring their content.
I'm using flexbox to lay things out.
I don't understand why it's behaving this way. I've tried tinkering with the css to get it to work differently, but nothing I've tried has had an impact.
Here's how the html is laid out:
<div class='board'>
<div class='board-row'>
<div class='square'>
<div class='number filled'>9</div>
</div>
<div class='square'>
<div class='note'>1</div>
<div class='note'>2</div>
<div class='note'>3</div>
<div class='note'>4</div>
<div class='note'>5</div>
<div class='note'>6</div>
<div class='note'>7</div>
<div class='note'>8</div>
</div>
<div class='square'>
<div class='note'>1</div>
...
</div>
...
</div>
...
</div>
and relevant css
body {
font-family: "helvetica";
font-size: 16px;
}
.board {
display: flex;
flex-direction: column;
font-family: monospace;
}
.board-row {
flex-direction: row;
}
.square {
height: 3em;
width: 3em;
border: 1px solid black;
align-items: center;
justify-content: center;
flex-wrap: wrap;
display: inline-flex;
}
.square .filled {
font-size: 2rem;
background-color: #CC0;
}
.square .note {
padding-left: 3px;
padding-right: 3px;
}
Here's a screenshot of what it looks like (with the notes bordered in red - they contain ' ')
link because I can't get it to embed: https://i.stack.imgur.com/ohVyw.jpg
I want the black-bordered squares to be aligned in a grid.