/ Published in: CSS

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* This will horizontally and vertically center an element, but requires that the height and width of it are known */ .centered { width:16px; height:16px; position:absolute; top:50%; left:50%; margin-left:-8px; margin-top:-8px; }
URL: http://www.dezinerfolio.com/2007/05/02/the-simplest-way-to-horizontally-and-vertically-center-a-div/
Comments
