Bottom to top <ul> element arrangement - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

Bottom to top <ul> element arrangement

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 {<!--  ww  w . j a  va 2 s .  c o  m-->
   width:211px;
}

li {
   display:block;
   float:left;
   width:49px;
   height:49px;
   margin:0;
   text-align:center;
   border:2px solid Chartreuse;
}

li:first-child,
li:first-child + li,
li:first-child + li + li,
li:first-child + li + li + li {
   margin:103px 0 -152px 0;
   border-color:yellow;
}

li:first-child + li + li + li + li,
li:first-child + li + li + li + li + li,
li:first-child + li + li + li + li + li + li,
li:first-child + li + li + li + li + li + li + li {
   margin:52px 0 -100px 0;
   border-color:blue;
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
   <li>L</li> 
  </ul>  
 </body>
</html>

Related Tutorials