Adjust background color to cover whole container - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Width

Description

Adjust background color to cover whole container

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 {<!--  ww  w .  j  a  v  a 2  s  .  c  o m-->
   background-color:Chartreuse;
   width:calc(100%);
   height:100%;
}

img {
   width:100px;
}

li {
   display:inline-block;
   padding:11px;
}
</style> 
 </head> 
 <body> 
  <div id="container">
    Smile Smile 
   <ul> 
    <li> <img src="https://www.java2s.com/style/demo/Firefox.png"> </li> 
    <li> <img src="https://www.java2s.com/style/demo/Opera.png"> </li> 
    <li> <img src="https://www.java2s.com/style/demo/Opera.png"> </li> 
    <li> <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> </li> 
    <li> <img src="https://www.java2s.com/style/demo/Safari.png"> </li> 
    <li> <img src="https://www.java2s.com/style/demo/InternetExplorer.png"> </li> 
    <li> <img src="https://www.java2s.com/style/demo/Safari.png"> </li> 
    <li> <img src="https://www.java2s.com/style/demo/Opera.png"> </li> 
    <li> <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> </li> 
    <li> <img src="https://www.java2s.com/style/demo/Google-Chrome.png"> </li> 
   </ul> 
  </div> 
  <div id="container">
    Footer Footer 
  </div>  
 </body>
</html>

Related Tutorials