Setting height 100% in relative positioning - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Relative Position

Description

Setting height 100% in relative positioning

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">
body, html {
   height:100%;
}

div {<!--from  w  ww.  ja v a2  s  .c o m-->
   width:100%;
   height:100%;
   position:relative;
   background:red;
}
</style> 
 </head> 
 <body> 
  <div></div>  
 </body>
</html>

Related Tutorials