CSS make UL list wrap LI in tile layout - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:UL Element

Description

CSS make UL list wrap LI in tile layout

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <title>Lorem ipsum d</title> 
  <style>
* {<!--  w  w  w.  j  a  va2  s  . c  om-->
   margin:0;
   padding:0;
}

body {
   background:green;
}

.container {
   margin:0 auto;
   background:yellow;
   text-align:center;
   overflow:auto;
   min-width:201px;
   max-width:901px;
   display:block;
   list-style:none;
}

li {
   background-color:Chartreuse;
   border:2px solid yellow;
   box-sizing:border-box;
   float:left;
   height:100px;
   width:100px;
   margin:5px 3px;
}

@media (min-width: 208px)  {
   .container {
      width:209px;
   }

}

@media (min-width: 312px)  {
   .container {
      width:313px;
   }

}

@media (min-width: 416px)  {
   .container {
      width:417px;
   }

}

@media (min-width: 520px)  {
   .container {
      width:521px;
   }

}

@media (min-width: 624px)  {
   .container {
      width:625px;
   }

}

@media (min-width: 728px)  {
   .container {
      width:729px;
   }

}

@media (min-width: 832px)  {
   .container {
      width:833px;
   }

}
</style> 
 </head> 
 <body translate="no"> 
  <ul class="container"> 
   <li></li> 
   <li></li> 
   <li></li> 
   <li></li> 
   <li></li> 
   <li></li> 
   <li></li> 
   <li></li> 
   <li></li> 
   <li></li> 
  </ul>  
 </body>
</html>

Related Tutorials