Scroll box lost padding! - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Box

Description

Scroll box lost padding!

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">
#parent {<!--from  ww w . j av a2  s  .  c o  m-->
   background-color:Chartreuse;
   overflow:auto;
   padding:0 21px;
   width:301px;
}

#child {
   width:521px;
}
</style> 
 </head> 
 <body> 
  <div id="parent"> 
   <div id="child"> 
    <img src="https://www.java2s.com/style/demo/Opera.png" alt=""> 
    <img src="https://www.java2s.com/style/demo/Google-Chrome.png" alt=""> 
    <img src="https://www.java2s.com/style/demo/Firefox.png" alt=""> 
    <img src="https://www.java2s.com/style/demo/InternetExplorer.png" alt=""> 
    <img src="https://www.java2s.com/style/demo/Safari.png" alt=""> 
    <img src="https://www.java2s.com/style/demo/InternetExplorer.png" alt=""> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials