I've found this answer, but it doesn't cover my problem: Are empty divs bad?
I have a tic-tac-toe game illustration, which looks roughly like this:
<div class="tic-tac-toe">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
And the CSS, relevant bits:
.tic-tac-toe {
display: block;
width: 109pt;
height: 109pt;
text-align: center;
margin: auto;
}
.tic-tac-toe div {
width: 32pt;
height: 26pt;
font-family: monospace;
font-weight: bold;
padding-top: 6pt;
background-color: #555;
float: left;
margin: 0;
-moz-box-shadow: 3px 3px 4px #909090;
-webkit-box-shadow: 3px 3px 4px #909090;
box-shadow: 3px 3px 4px #909090;
}
.tic-tac-toe div:nth-child(1),
.tic-tac-toe div:nth-child(4),
.tic-tac-toe div:nth-child(7) {
margin-right: 6pt;
}
. . . /* for other sides */
There are some CSS at work here and a bit of JavaScript. Is there anything I could use instead of divs? I really need just a square block I can paint the background and put a letter "X" or "O" inside. What am I to do?