HTML CSS examples for CSS Widget:UL Element
Maintain the li width according to the content
<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>