Maintain the li width according to the content - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

Maintain the li width according to the content

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 li {
   background-color:Chartreuse;
   margin:6px;
   list-style:none;
   float:left;
   clear:left;
}
</style> <!--from  w ww  .j a  v a  2s .  c o  m-->
 </head> 
 <body>
   Lorem ipsum dolor 
  <ul> 
   <li>Lorem</li> 
   <li>Lore</li> 
   <li>Lor</li> 
  </ul>  
 </body>
</html>

Related Tutorials