Expand li elements to container size - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

Expand li elements to container size

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <style>
#main-menu {<!--from  w w  w.  j av a2s  .  c o m-->
   background-color:Chartreuse;
   border:2px solid yellow;
   width:601px;
   overflow:hidden;
}

ul, li {
   margin:0;
   padding:0;
}

.menu {
   list-style:none outside none;
   text-align:center;
}

.menu-item {
   float:left;
   width:26%;
}

.menu-item a {
   border:2px solid blue;
}
</style> 
 </head> 
 <body translate="no"> 
  <div id="main-menu"> 
   <ul class="menu"> 
    <li class="menu-item"> <a href="#">Lorem i</a> </li> 
    <li class="menu-item"> <a href="#">Lorem i</a> </li> 
    <li class="menu-item"> <a href="#">Lorem i</a> </li> 
    <li class="menu-item"> <a href="#">Lorem i</a> </li> 
   </ul> 
  </div>  
 </body>
</html>

Related Tutorials