Fluid horizontal nav
Here's a demo
HTML:
<ul class="nav nav--fluid">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Gallery</a></li>
<li><a href="#">Why us?</a></li>
<li><a href="#">Contact</a></li>
</ul>
CSS:
.nav {
margin: 0;
padding: 0;
}
.nav--fluid {
display: table;
width: 100%;
}
.nav--fluid > li {
display: table-cell;
text-align: center;
}
Written by Kasper Mikiewicz
Related protips
3 Responses
Good tip, thanks! Unfortunately, IE7 doesn't support display: table.
over 1 year ago
·
Good stuff... I'm curious about the naming convention the css. More specifically, the "--" in ".nav--fluid". Wondering if this selector is being constructed to reflect the type/role/function/behavior of the element the selector corresponds to, or if it's arbitrary and I'm trying to read too far into it? It definitely looks like there's some kind of pattern being followed.
over 1 year ago
·
@pointpointclick And you're right :) read this http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Related Tags
#css
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#