Compare difference between UL block and inline block - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Horizontal

Description

Compare difference between UL block and inline block

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 {<!--from   w  w  w. j  av a2  s .  com-->
   list-style-type:none;
   margin:0;
   padding:0;
   background-color:Chartreuse;
}

li a {
   display:block;
   color:yellow;
   padding:9px 17px;
   text-decoration:none;
}

#inline li {
   display:inline-block;
}
</style> 
 </head> 
 <body> 
  <p> <code>L</code>Lorem i</p> 
  <ul> 
   <li> <a href="default.asp">Lore</a> </li> 
   <li> <a href="news.asp">Lore</a> </li> 
   <li> <a href="contact.asp">Lorem i</a> </li> 
   <li> <a href="about.asp">Lorem</a> </li> 
  </ul> 
  <p> <code>Lo</code>Lorem ipsum do</p> 
  <ul id="inline"> 
   <li> <a href="default.asp">Lore</a> </li> 
   <li> <a href="news.asp">Lore</a> </li> 
   <li> <a href="contact.asp">Lorem i</a> </li> 
   <li> <a href="about.asp">Lorem</a> </li> 
  </ul>  
 </body>
</html>

Related Tutorials