CSS menu right aligned with markup: UL>LI>UL>LI - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Menu

Description

CSS menu right aligned with markup: UL>LI>UL>LI

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">
ul {<!--   w  ww  .  j a va 2s.c  om-->
   margin:0;
   padding:0;
   list-style-type:none;
   line-height:2.4;
   font-size:2em;
   text-align:right;
}

ul li {
   position:relative;
   clear:right;
}

ul li a {
   display:inline-block;
   position:relative;
   float:right;
}

ul li ul {
   display:none;
   position:relative;
   margin:0 0 0 0;
   padding:0px 6px 0px 26px;
   white-space:nowrap;
   z-index:1000;
}

ul li:hover ul {
   display:inline-block;
}

ul li ul li {
   float:left;
   margin:0 10px;
}

ul li ul li span {
   font-size:0.9em;
   margin:0 2px 0 -3px;
   float:left;
   cursor:default;
}

ul li ul:after {
   content:' | ';
   font-size:0.9em;
   margin:0 2px 0 -3px;
   cursor:default;
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li> <a href="#">Lorem</a> 
    <ul> 
     <li> <a href="#">Lorem i</a> </li> 
     <li> <a href="#">Lorem</a> </li> 
    </ul> </li> 
   <li> <a href="#">Lorem ip</a> 
    <ul> 
     <li> <a href="#">Lorem</a> </li> 
     <li> <a href="#">Lor</a> </li> 
    </ul> </li> 
   <li> <a href="#">Lore</a> 
    <ul> 
     <li> <a href="#">Lorem ip</a> </li> 
     <li> <a href="#">Lorem ip</a> </li> 
    </ul> </li> 
  </ul>  
 </body>
</html>

Related Tutorials