css - Center Nav menu using floating -
css - Center Nav menu using floating -
hi tried center navigation menu using floating css element didn't work. have advices?
<header> <div id="top-banner"> <img src="images/headerlines.png" alt="lines"> </div> <div id="logo"> <img src="images/logo.png" alt="logo"> </div> <nav> <ul class="nav"> <li><a href="text.html">about</a></li> <li><a href="tables.html">price</a></li> <li><a href="forms.html">contact us</a></li> </ul> </nav> </header>
css
.nav li{ width:960px; list-style:none; float:left; } .nav { display:block; text-align:center; width:320px; text-decoration:none; }
sorry guys, first time posting question on stackoverflow.
you can :)
class="snippet-code-css lang-css prettyprint-override">.nav { width: 960px; margin: 0px; padding: 0px; list-style: none; text-align: center; } .nav li{ display: inline-block; } .nav { text-decoration: none; margin: 0px 30px; }
class="snippet-code-html lang-html prettyprint-override"><header> <div id="top-banner"> <img src="images/headerlines.png" alt="lines"> </div> <div id="logo"> <img src="images/logo.png" alt="logo"> </div> <nav> <ul class="nav"> <li><a href="text.html">about</a> </li> <li><a href="tables.html">price</a> </li> <li><a href="forms.html">contact us</a> </li> </ul> </nav> </header>
css
Comments
Post a Comment