Create Navigation Bar with background - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Nav Bar

Description

Create Navigation Bar with background

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 ul {<!--from ww w .j av a 2 s  . co m-->
   text-align:center;
   list-style-type:none;
}

#nav li {
   float:left;
}

#nav a:link, a:visited {
   margin-left:auto;
   margin-right:auto;
   display:block;
   width:121px;
   font-weight:bold;
   color:Chartreuse;
   background-color:yellow;
   text-align:center;
   padding:5px;
   text-decoration:none;
   text-transform:uppercase;
}

#nav a:hover, a:active {
   background-color:blue;
}
</style> 
 </head> 
 <body> 
  <div id="nav"> 
   <ul> 
    <li> <a href="#home">Lore</a> </li> 
    <li> <a href="#news">Lore</a> </li> 
    <li> <a href="#contact">Lorem i</a> </li> 
    <li> <a href="#about">Lorem</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials