CSS - Responsive div with background - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

CSS - Responsive div with background

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 {<!--  w w w. j a  v  a2s . c  o m-->
   width:100%;
   padding-bottom:57.26%;
   background:transparent url('https://www.java2s.com/style/demo/Google-Chrome.png') no-repeat center;
   background-size:100%;
}
</style> 
 </head> 
 <body> 
  <div id="container"> 
  </div>  
 </body>
</html>

Related Tutorials