/ Published in: CSS
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
.vertical { width: 600px; /*--Specify Width--*/ height: 300px; /*--Specify Height--*/ position: absolute; /*--Set positioning to absolute--*/ top: 50%; /*--Set top coordinate to 50%--*/ left: 50%; /*--Set left coordinate to 50%--*/ margin: -150px 0 0 -300px; /*--Set negative top/left margin--*/ }
URL: http://www.smashingmagazine.com/2009/10/05/mastering-css-coding-getting-started/#CSS-Basics3