Aligning and floating nav bar to the right - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Float

Description

Aligning and floating nav bar to the right

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style type="text/css">
body<!--   w ww .jav  a 2s  .  c  o  m-->
 {
   font:normal 301 .9em 'Open Sans', sans-serif;
   overflow-x:hidden;
}

div
 {
   float:left;
   width:100%;
   background-color:Chartreuse;
}

ul
 {
   float:right;
   background-color:yellow;
   height:21px;
}

li {
   float:left;
}

ul a
 {
   color:blue;
   padding:0 11px;
   text-decoration:none;
}

ul a:hover {
   color:pink;
}
</style> 
 </head> 
 <body> 
  <div> 
   <ul> 
    <li> <a href="index.html">Home</a> </li> 
    <li> <a href="company.html">Company</a> </li> 
    <li> <a href="team.html">Management Team</a> </li> 
    <li> <a href="contact.html">Contact</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials