Style HTML5 navigation bar - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Nav Bar

Description

Style HTML5 navigation bar

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">
* {<!--  w  w w . j  av a  2 s. c  o  m-->
   box-sizing:border-box;
}

body {
   margin:0;
   padding:0;
   font-family:Verdana;
   font-size:13px;
}

.wrapper {
   max-width:100%;
   margin-left:auto;
   margin-right:auto;
   text-align:center;
}

nav ul {
   background-color:Chartreuse;
}

nav ul li {
   display:inline-block;
   padding:16px;
}

nav ul li a {
   text-decoration:none;
   color:yellow;
}

nav ul li:first-child:hover {
   text-decoration:underline;
   background-color:blue;
}

nav ul li:hover {
   background-color:pink;
}

@media (max-width: 960px)  {
   nav {
      text-align:left;
   }

}
</style> 
 </head> 
 <body> 
  <div class="wrapper"> 
   <header> 
    <nav class="nav"> 
     <ul> 
      <li> <a href="#">Lore</a> </li> 
      <li> <a href="#">Lorem i</a> </li> 
      <li> <a href="#">Lorem ipsum dolor</a> </li> 
      <li> <a href="#">Lorem ipsum dolor</a> </li> 
      <li> <a href="#">Lorem ipsu</a> </li> 
      <li> <a href="#">Lorem ips</a> </li> 
     </ul> 
    </nav> 
   </header> 
  </div>  
 </body>
</html>

Related Tutorials