For some reason, I can’t get a div to display. When this happens, it’s usually a stupid typo, but I searched for 10 minutes, rewrote the entire css file, and searched another 20 minutes, and I can’t find anything like that. I’ve got a div that’s centered, and another div inside that. The parent shows up fine, but the child inside it doesn’t. Here’s my CSS:
*{
margin: 0px;
padding: 0px;
}
#chartBox {
width: 510px;
height: 510px;
background: #FFFF00;
margin: 20px auto 0px auto;
}
#11 {
display: inline-block;
border: 1px solid #FFFFFF;
width: 100px;
height: 100px;
background: #000000;
}
And my HTML body (just link to css and title outside the body):
<body>
<div id="chartBox">
<div id="11">
</div>
</div>
</body>
If I enter text in 11, the text shows up in the corner of chartBox, but the div’s background and border don’t show up.
You can’t use only numbers in div like “11”. Rename it to “div11”.