I'm working on creating a tic-tac-toe game, but I'm struggling to get the x and o marks to align properly both vertically and horizontally.
Take a look at my code below. The "marked" values are the ones containing letters:
ul {
display: flex;
flex-wrap: wrap;
width: 456px;
list-style: none;
padding-inline-start: 0;
}
li {
width: 150px;
height: 150px;
border: 1px solid black;
background-color: gray;
display: flex;
justify-content: center;
align-items: center;
}
li:hover {
background-color: yellow;
}
figure {
display: flex;
justify-content: center;
}
.marked {
font-family: Arial, Helvetica, sans-serif;
font-size: 10em;
}
<h1>Tic Tac Toe</h1>
<figure class="ttt">
<ul>
<li class="marked">o</li>
<li class="marked">x</li>
<li class="marked">o</li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</figure>
I've experimented with different methods to align the text, including using divs, various properties, values, text types, and display types, but I can't seem to get it right. Here's a sample of what I'm dealing with:
https://i.sstatic.net/K8TT1.png
It appears to be off-center vertically, and while horizontally seems okay, it may still not be pixel-perfect. I've spent hours on this, so any advice would be greatly appreciated!