show 3 <li> in one row - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

show 3 <li> in one row

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">
li {<!-- ww  w .  j a  v a  2 s. c o  m-->
   float:left;
   background:Chartreuse;
   padding:11px;
   border:2px solid yellow;
}

li:nth-child(3n+4) {
   clear:both;
}
</style> 
 </head> 
 <body> 
  <ul> 
   <li></li> 
   <li></li> 
   <li></li> 
   <li></li> 
   <li></li> 
   <li></li> 
   <li></li> 
   <li></li> 
   <li></li> 
  </ul>  
 </body>
</html>

Related Tutorials