I've been tackling a drop-down navigation menu, and I've managed to get it close to what I envisioned. However, aligning the Logo (which is essentially just h1 text) and the tagline with the navigation has proven to be a challenge.
Here's the HTML for the logo and tagline:
<div class="logo grid_5 omega">
<ul>
<li><a href="default.html"><h1>karma.</h1></a></li>
<li><p id="tagline">A stop motion animation</p></li>
</ul>
</div>
And this is the corresponding CSS code so far:
/* Header (Logo) -------------------------------------------------- */
.header.grid_12.omega {
margin-top:40px;
box-shadow:0 3px 10px #222;
background:#FFFFFF;
}
.logo.grid_5.omega {
float:left;
}
The HTML for the navigation menu is:
<nav class="grid_7 omega">
<ul>
<li><a href="about.html">About</a></li>
<li><a href="design.html">Process</a>
<ul>
<li><a href="#">Models</a></li>
<li><a href="#">Backgrounds</a></li>
<li><a href="#">Animation</a></li>
<li><a href="#">Post-production</a></li>
</ul>
</li>
<li><a href="style.html">Style</a></li>
<li><a href="reflection.html">Reflection</a></li>
</ul>
</div>
</nav>
Here is the CSS for the navigation:
/* Drop down nav ---------------------------------------- */
nav ul ul {
display:none;
}
nav ul li:hover > ul {
display: block;
}
nav ul {
background: #FFF;
padding: 0 20px;
list-style: none;
position: relative;
display: inline-table;
}
nav ul:after {
content: ""; clear: both; display: block;
}
nav ul li {
float: left;
}
nav ul li:hover {
background: #4b545f;
}
nav ul li:hover a {
color: #fff;
}
nav ul li a {
display: block; padding: 25px 40px;
color: #757575; text-decoration: none;
}
nav ul ul {
background: #5f6975; border-radius: 0px; padding: 0;
position: absolute; top: 100%;
}
nav ul ul li {
float: none;
border-top: 1px solid #6b727c;
border-bottom: 1px solid #575f6a;
position: relative;
}
nav ul ul li a {
padding: 15px 40px;
color: #fff;
}
nav ul ul li a:hover {
background: #4b545f;
}
Despite my efforts, there's still some misalignment as shown in the following image: