Set position of relatively-placed items - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Relative Position

Description

Set position of relatively-placed items

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">
body {<!--from w w w. j a v  a  2 s. co  m-->
   background:black;
   font-family:sans-serif;
}

li {
   float:left;
   text-align:center;
}

a {
   width:81px;
   display:block;
   font-size:17px;
   color:Chartreuse;
   text-decoration:none;
   padding:4px 17px;
}

a:hover {
   font-weight:bold;
   font-style:italic;
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li> <a id="projectslink" href="#projects">Lorem ip</a> </li> 
   <li> <a id="innovationslink" href="#innovations">Lorem ipsum</a> </li> 
   <li> <a id="newslink" href="#news">Lore</a> </li> 
   <li> <a id="aboutlink" href="#about">Lorem</a> </li> 
   <li> <a id="contactlink" href="#contact">Lorem i</a> </li> 
   <li> <a id="breathlink" href="#">Lorem i</a> </li> 
  </ul>  
 </body>
</html>

Related Tutorials