html - Page Navigation Won't Stay On One Line -


here html:

<div id="leftmenu">     <ul>       <li class="border"><a href="index.html">home</a></li>       <li class="border"><a href="services.html">services</a></li>       <li class="border"><a href="ourwork.html">our work</a></li>       <li class="border"><a href="testimonials.html">testimonials</a></li>       <li class="border"><a href="clients.html">clients</a></li>       <li class="border"><a href="quote.html">get quote</a></li>       <li class="border"><a href="documents.html">documents &amp; forms</a></li>       <li class="border"><a href="charities.html">charity information</a></li>       <li class="border"><a href="jobs.html">need job or gig?</a></li>       <li class="border"><a href="casting.html">casting calls</a></li>       <li><a href="ourteam.html">our team</a></li>      </ul> </div> 

here css:

#leftmenu {     position:relative;     min-width:100%;     background-color:white;     border-top:1px solid gray; }  #leftmenu ul li{     float:left;     padding:7px;     font-family:georgia;     font-size:small;     -webkit-box-shadow:inset 0px 0px 20px rgba(0,0,0,0.1);     -webkit-box-shadow:0px 0px 5px rgba(0,0,0,0.4); } 

what looking have nav bar resize fit parent element in. want resize depending on screen size well. have tested on dell 15 inch laptop screen , tested on mac 26 inch screen , nav bar doesn't extend way end of centered div on mac screen on dell screen. if extend on mac screen, overflows on smaller dell screen. have deal short nav bar on mac screen in order work on smaller screens?

you can use display:table; et al, make fit how need fit. moved border switch last list item don't have use many classes.

<!doctype html> <html> <head>     <title>untitled page</title>     <meta charset="utf-8" />     <style type="text/css">         #leftmenu { display: table; width: 100%; }         ul { display: table-row; }         li { border-right: solid 1px #f08; display: table-cell; height: 3em; }         li.noborder { border: none; }     </style> </head> <body>     <div id="leftmenu">         <ul>             <li><a href="index.html">home</a></li>             <li><a href="services.html">services</a></li>             <li><a href="ourwork.html">our work</a></li>             <li><a href="testimonials.html">testimonials</a></li>             <li><a href="clients.html">clients</a></li>             <li><a href="quote.html">get quote</a></li>             <li><a href="documents.html">documents &amp; forms</a></li>             <li><a href="charities.html">charity information</a></li>             <li><a href="jobs.html">need job or gig?</a></li>             <li><a href="casting.html">casting calls</a></li>             <li class="noborder"><a href="ourteam.html">our team</a></li>         </ul>     </div> </body> </html> 

just make sure there enough horizontal room because know how tables spill on containers when necessary.

or mentioned above use display:inline; on li , let wrap.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -