Nathan30 Nathan30 - 7 months ago 27
HTML Question

Background div menu issue

I want to make a menu with a colored background. I use the simple "background" or "background-color" on the div containing the of my menu but I don't see any color. I know it's dumb but I'm really stuck..

Here is the HTML :

<header class="menu-top">
<div class="menu">
<ul>
<li><a>Home</a></li>
<li><a>Portfolio</a></li>
<li><a>Contact</a></li>
</ul>
</div>
</header>


Here is the JSFIDDLE : https://jsfiddle.net/szf1xksv/

Answer

An alternative could be to use:

.menu > ul > li {
  display: inline-block;
}

This will preserve the height of the list items.