html5 - Responsive Navigation menu not working -


i trying design responsive nav bar. dont know css3. except tablet, nav bar works fine. please me missing tablet size. need add media query tablet size? or changes needs done in nav tags

<nav class="clearfix">     <ul class="clearfix">          <li><a href="#">home</a></li>          <li><a href="#">menu1</a></li>          <li><a href="#">menu1</a></li>          <li><a href="#">menu1</a></li>          <li><a href="#">menu1</a></li>          <li><a href="#">menu1</a></li>           <li><a href="#">menu1</a></li>           <li><a href="#">menu1</a></li>      </ul>     <a href="#" id="pull">menu</a> </nav> 

here css nav

nav {     height: 40px;     width: 100%;     background: #455868;     font-size: 11pt;     font-family: 'pt sans', arial, sans-serif;     font-weight: bold;     position: relative;     border-bottom: 2px solid #283744; } nav ul {     padding: 0;     margin: 0 auto;     width: 80%;     height: 40px; } nav li {     display: inline;     float: left; } nav {     color: #fff;     display: inline-block;     width: 100px;     text-align: center;     text-decoration: none;     line-height: 40px;     text-shadow: 1px 1px 0px #283744; } nav li {     border-right: 1px solid #576979;     box-sizing:border-box;     -moz-box-sizing:border-box;     -webkit-box-sizing:border-box; } nav li:last-child {     border-right: 0; } nav a:hover, nav a:active {     background-color: #8c99a4; } nav a#pull {     display: none; }  /*styles screen 600px , lower*/ @media screen , (max-width: 600px) {     nav {          height: auto;     }     nav ul {         width: 100%;         display: block;         height: auto;     }     nav li {         width: 50%;         float: left;         position: relative;     }     nav li {         border-bottom: 1px solid #576979;         border-right: 1px solid #576979;     }     nav {         text-align: left;         width: 100%;         text-indent: 25px;     } }  /*styles screen 515px , lower*/ @media screen , (max-width : 480px) {     nav {         border-bottom: 0;     }     nav ul {         display: none;         height: auto;     }     nav a#pull {         display: block;         background-color: #283744;         width: 100%;         position: relative;     }     nav a#pull:after {         content:"";         background: url('nav-icon.png') no-repeat;         width: 30px;         height: 30px;         display: inline-block;         position: absolute;         right: 15px;         top: 10px;     } }  /*smartphone*/ @media screen , (max-width : 320px) {     nav li {         display: block;         float: none;         width: 100%;     }     nav li {         border-bottom: 1px solid #576979;     } } .clearfix:before, .clearfix:after {     content: " ";     display: table; } .clearfix:after {     clear: both; } .clearfix {     *zoom: 1; 

you try this: http://jsfiddle.net/98jxl/2/

i have added new media query 1000px. distribute menu items evenly on screen width. solution based on having 8 menu items.

/*styles screen 1000px , lower*/ @media screen , (max-width: 1000px) {     nav ul {         width: 100%;     }      nav li {         width: 12.5%;     }      nav {         width: 100%;     } } 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -