Relative parent, absolute positioning vertically by percentage - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Relative Position

Description

Relative parent, absolute positioning vertically by percentage

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 {<!--from  w  w w . ja v a  2 s .c  om-->
   position:relative;
   width:501px;
   height:501px;
}

.content {
   position:absolute;
   left:11%;
   top:51%;
}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="content">
     Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi ullamcorper mole 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials