Centering UL navigation horizontally - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Nav bar alignment

Description

Centering UL navigation horizontally

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">
#footer-share-links {<!--from  w ww .j a va2s  .  c o  m-->
   width:401px;
   text-align:center;
   margin:11px auto;
   background:Chartreuse;
   border:2px solid yellow;
   height:37px;
}

#footer-share-links ul {
   padding:0;
   position:relative;
   list-style-type:none;
   margin:0;
}

#footer-share-links li {
   display:inline-block;
   width:27px;
   height:37px;
   background-image:url('https://www.java2s.com/style/demo/Google-Chrome.png');
   background-position:center;
}

#footer-share-links li a {
   display:block;
}
</style> 
 </head> 
 <body> 
  <div id="footer-share-links"> 
   <ul> 
    <li id="ftr_facebook"> <a href=""></a> </li> 
    <li id="ftr_twitter"> <a href=""></a> </li> 
    <li id="ftr_gplus"> <a href=""></a> </li> 
    <li id="ftr_linkedin"> <a href=""></a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials