I've started with HTML and CSS a couple weeks ago and this happened several times, and I don't know why.
Sometimes I apply a background to the parent element, include something on it, but the height
of the parent stays 0
instead receiving height
of the children. And sometimes it does (which I believe should be the correct behavior no?)
My glossarySelector gets 0
height. Therefore my background color is not displayed.
.glossarySelector {
background: #EFEFEF;
}
<div class="glossarySelector">
<ul>
<li><a href="#">A</a></li>
<li><a href="#">B</a></li>
<li><a href="#">C</a></li>
<li><a href="#">D</a></li>
<li><a href="#">E</a></li>
</ul>
</div>
Why?
You can see the full code here.