Centering page while body position:Absolute; - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

Centering page while body position:Absolute;

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">
#menu {<!--from w  w  w .j  ava2 s. c  o m-->
   position:absolute;
   top:0;
   width:71px;
   height:181px;
   left:51%;
   right:51%;
   background-color:Chartreuse;
}
</style> 
 </head> 
 <body> 
  <div id="menu"></div>  
 </body>
</html>

Related Tutorials