Vertical Centering with CSS
According to http://www.w3.org/Style/Examples/007/center.en.html#vertical
CSS level 2 doesn’t have a property for centering things vertically. There will probably be one in CSS level 3. But even in CSS2 you can center blocks vertically, by combining a few properties. The trick is to specify that the outer block is to be formatted as a table cell, because the contents of a table cell can be centered vertically.
That page points to a horizontal and vertical centering example (which seems to be a common need): http://www.w3.org/Style/Examples/007/center-example
To cater for various (mainly older) web browsers and peculiarities in CSS implementations, many vertical centering techniques have been developed. Here are some related links:
- http://blog.themeforest.net/tutorials/vertical-centering-with-css
(test page: http://douglasheriot.com/tutorials/css_vertical_centre/demo4.html) - http://www.vanseodesign.com/css/vertical-centering/
- http://hicksdesign.co.uk/journal/how-to-vertical-centering-with-css
- http://www.jakpsatweb.cz/css/css-vertical-center-solution.html
Comments (0)
Trackbacks (0)
Leave a comment
Trackback