HTML CSS examples for CSS Layout:Position
position a div in accordance to another div's margin
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .header {<!-- w w w .ja v a2s . c o m--> width:100%; height:100px; position:fixed; top:0; background-color:Chartreuse; } .container { margin:0 auto; margin-top:100px; margin-bottom:100px; } </style> </head> <body> <div class="header"></div> <div class="container"> <p>Lorem ipsum dolor sit </p> </div> </body> </html>