Set a max-width larger than 100% - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Width

Description

Set a max-width larger than 100%

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">
.container {<!--from  w w  w .  j a  va2s . co m-->
   width:501px;
   overflow:auto;
}

.list {
   width:5001px;
}

ul {
   width:5001px;
   overflow:visible;
   width:auto;
   display:inline-block;
}

li {
   background:Chartreuse;
   display:inline-block;
   margin:0 6px;
   padding:3px 6px;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="list"> 
    <ul> 
     <li>Banana</li> 
     <li>AAA</li> 
     <li>BBB</li> 
     <li>CCC</li> 
     <li>DDD</li> 
     <li>EEE</li> 
    </ul> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials