Return to Snippet

Revision: 70249
at December 22, 2015 15:49 by AdriaanQ


Initial Code
position:relative;
height:600px;
top: 50%;
margin-top: -300px; /* minus half the height */
left:50%;
margin-left:-300px /* minus half the width */
width:600px;

Initial URL

                                

Initial Description
Center X and Y of fixed element, you must know the width and height

Initial Title
Vertical & Horizontal center a fixed element

Initial Tags

                                

Initial Language
CSS