HTML CSS examples for CSS Layout:Relative Position
Relative parent, absolute positioning vertically by percentage
<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>