Why is there a space under every row? (css)
I'm trying to make a Next.js tic-tac-toe application to test my skills. However, I am running into an issue with the css. There seems to be a padding issue maybe under every board row- just a small space underneath every row. An image is attached.
I've tried setting padding and margin to 0 in almost all places. Here's my css.
body {
background-color: black;
height: 100vh;
width: 100vw;
margin: 0;
padding: 0;
}
* {
box-sizing: border-box;
}
h1, h2, h3, h4, h5, h6, p {
margin-top: 0;
padding: 0;
}
.square {
height: 30vmin;
width: 30vmin;
font-size: 25vmin;
border: 2px solid white;
display: flex;
justify-content: center;
align-items: center;
background-color: black;
color: white;
float: left;
margin-top: -1px;
margin-right: -1px;
line-height: 30vmin;
padding: 0;
}
.squareContainer {
display: inline-block;
}
.boardContainer {
border: 2px solid white;
display: inline-block;
margin: 0;
}
.container {
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
}
.boardRow:after {
clear: both;
content: '';
display: table;
padding: 0;
}
Here's the JSX for the board:
<div className={styles.boardContainer}>
<div className={styles.boardRow}>
<Square value={squares[0]} onSquareClick={() => handleClick(0)}/>
<Square value={squares[1]} onSquareClick={() => handleClick(1)}/>
<Square value={squares[2]} onSquareClick={() => handleClick(2)}/>
</div>
<div className={styles.boardRow}>
<Square value={squares[3]} onSquareClick={() => handleClick(3)}/>
<Square value={squares[4]} onSquareClick={() => handleClick(4)}/>
<Square value={squares[5]} onSquareClick={() => handleClick(5)}/>
</div>
<div className={styles.boardRow}>
<Square value={squares[6]} onSquareClick={() => handleClick(6)}/>
<Square value={squares[7]} onSquareClick={() => handleClick(7)}/>
<Square value={squares[8]} onSquareClick={() => handleClick(8)}/>
</div>
</div>
and for the squares:
<div className={styles.squareContainer}>
<button className={styles.square} onClick={onSquareClick}>
<p>
{ value }
</p>
</button>
</div>
I don't know the problem, please help.