html - Getting a nav bar to have equal spaces -
i have slight problem code trying on navbar, each section have equal amount of space , not have space according how many characters have in title. example, map should have as about.
here looks now:

.wrap { width: 90%; background-image: url(images/navbarbackground.png); background-repeat: no-repeat; margin: auto; box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.3); padding: 0px; font-family: minecrafter; } .wrap:after { content: " "; clear: both; display: block; height: 0; visibility: hidden; } .wrap ul { display: table; width: 95%; } .wrap li { display: table-cell; vertical-align: middle; } .wrap li { text-decoration: none; background-color: #eeeeee; color: #666666; padding: 6px 0 6px 0; border: 1px solid #ccc; border-right: 1px solid #333; border-bottom: 1px solid #333; display: block; text-align: center; } .wrap h2 { margin-top: 10px; margin-bottom: 10px; text-transform: uppercase; color: #ffffff; width: 6em; text-align: center; line-height: 1.0; letter-spacing: .04em; display: in line-block; vertical-align: middle; float: left; } .wrap h2 span { display: block; letter-spacing: .17em; } .navwrap { margin-top: 0px; overflow: hidden; padding-top: 16px; padding-bottom: 0px; margin-bottom: 10px; } <div class="wrap"> <h2 class="minecrafter">miners <span>union</span></h2> <div class="navwrap"> <ul class="nav"> <li><a href="#">home</a> </li> <li><a href="#">forums</a> </li> <li><a href="#">donate</a> </li> <li><a href="#">apply</a> </li> <li><a href="#">map</a> </li> </ul> </div> </div>
you try this: fiddle
.wrap ul { width:100%; padding: 0; } .wrap li { display:inline-block; float: left; width: 20%; vertical-align:middle; }
Comments
Post a Comment