Css position setup to place text in the center of a page - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Position

Description

Css position setup to place text in the center of a page

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">
[id='404-wrapper']
 {
   width:401px;
   height:201px;
   position:fixed;
   left:51%;
   top:51%;
   margin-top:-100px;
   margin-left:-201px;
}

[id='404-wrapper']wrapper a {
   font-size:15px;
   line-height:121%;
}
</style> <!--from ww  w .  j av  a  2s  . c o m-->
 </head> 
 <body> 
  <div id="404-wrapper"> 
   <a href="index.html">Lorem ipsum dolor sit amet, consectetur adipiscing e<br>Lorem ipsum dolor sit amet, con</a> 
  </div> 
  <!--404 wrapper-->  
 </body>
</html>

Related Tutorials