Center LI items in navbar DIV - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Nav Bar Item

Description

Center LI items in navbar DIV

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
#nav {<!--  w w w. ja  v  a2 s . c  om-->
   text-align:center;
}

#nav li {
   list-style:none;
   display:inline-block;
}

#nav a {
   color:Chartreuse;
   display:block;
   font-family:arial;
   text-transform:uppercase;
   font-weight:bold;
   margin:0;
   padding:10px 19px 10px;
   text-decoration:none;
}

#nav a:hover {
   background-color:yellow;
   color:blue;
}
</style> 
 </head> 
 <body> 
  <ul id="nav"> 
   <li> <a href="/">Lore</a> </li> 
   <li> <a href="/about.me">Lorem</a> </li> 
   <li> <a href="/ask">Lor</a> </li> 
   <li> <a href="http://twitter.com/ThatsWhatKidsDO">Lorem i</a> </li> 
   <li> <a href="/support">Lorem </a> </li> 
   <li> <a href="/tagged/typography">Lorem ipsu</a> </li> 
   <li> <a href="http://www.tumblr.com/directory/recommend/typography/epicjamess">Lorem ipsu</a> </li> 
   <li> <a href="/FAQ">Lor</a> </li> 
  </ul>  
 </body>
</html>

Related Tutorials