HTML CSS examples for CSS Layout:Absolute Position
position a div in the absolute center of a page
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> body {<!-- w w w . j a va 2s . co m--> height:10001px; } #myDiv { background:red; width:100px; height:100px; margin-top:-51px; margin-left:-51px; position:fixed; top:51%; left:51%; } </style> </head> <body> <div id="myDiv"></div> </body> </html>