Position absolute div in center of screen view - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Absolute Position

Description

Position absolute div in center of screen view

Demo Code

ResultView the demo in separate window

<html lang="en">
 <head> 
  <title>Lorem i</title> 
  <style>
#demo<!--from  w w w . j a va  2 s.  c o m-->
 {
   width:141px;
   height:100px;
   border:2px solid Chartreuse;
   text-align:left;
   position:fixed;
   top:51%;
   left:51%;
   margin-left:-71px;
   margin-top:-51px;
}
</style> 
 </head> 
 <body translate="no"> 
  <div id="demo">
    Lorem ipsu 
  </div>  
 </body>
</html>

Related Tutorials