/ Published in: CSS

Here's a simple way to get your div always on center in any screen size.
margins should be half of width and height.
margins should be half of width and height.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
.centerDiv{ width:968px; height:600px; background:#ccc; position:absolute; margin-top:-300px; margin-left:-484px; top:50%; left:50%; }
Comments
