HTML CSS examples for CSS Layout:Relative Position
Fixed position is relative to parent container
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> div.fixed {<!--from w ww .j a v a 2 s . c om--> position:fixed; top:100px; width:31px; height:31px; border:4px solid Chartreuse; background-color:yellow; } div.fixed2 { position:fixed; top:11px; left:11px; width:31px; height:31px; border:4px solid blue; background-color:pink; } </style> </head> <body> <div class="fixed"> <div class="fixed2"></div> </div> </body> </html>