HTML CSS examples for CSS Layout:Relative Position
Relatively positioned element in front of fixed element
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .header {<!--from w ww .ja v a2s .c om--> background-color:Chartreuse; position:absolute; top:0; left:0; width:100%; height:51px; } .hook { background-color:yellow; position:fixed; top:0; left:0; width:201px; height:51px; } .navbar { background-color:blue; position:absolute; top:0; left:0; width:51px; height:100%; } .content { background-color:pink; position:relative; top:0; left:0; width:100px; height:51px; } </style> </head> <body> <div id="header"> Lorem ipsu </div> <div class="hook"> Lorem i </div> <div class="navbar"> Lorem ipsu </div> <div class="content"> Lorem ipsu </div> </body> </html>