Centering nav bar on page - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Nav bar alignment

Description

Centering nav bar on page

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 {<!-- ww  w .  j  ava2 s.  co m-->
   background:Chartreuse;
   height:51px;
   text-align:center;
}

#nav li {
   color:yellow;
   display:inline-block;
   line-height:51px;
   margin:0 11px;
}
</style> 
 </head> 
 <body> 
  <ul id="nav"> 
   <li>Lore</li> 
   <li>Lorem</li> 
   <li>Lore</li> 
   <li>Lore</li> 
   <li>Lore</li> 
   <li>Lorem i</li> 
  </ul>  
 </body>
</html>

Related Tutorials