Retain a responsive div size for an image container before fadeIn - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Layout

Description

Retain a responsive div size for an image container before fadeIn

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 {<!-- www .ja  v a  2 s.  c o m-->
   display:inline-block;
   position:relative;
   width:100%;
}

#box {
   padding-top:26%;
}

#element {
   position:absolute;
   top:0;
   bottom:0;
   left:0;
   right:0;
   background:red;
}
</style> 
 </head> 
 <body> 
  <div id="Container"> 
   <div id="box"></div> 
   <div id="element"> 
    <!-- add content here --> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials