The other day my brother was having a problem getting an element to vertically centered using CSS. I knew I had seen something that dealt this exact issue. I also know I've done this in the past, but couldn't spout it off the tip of my tongue.
Web Page Design for Designers has an editorial/example called Dead Centre that shows exactly how to do this. It's a nice demo. This is what I was recalling yesterday to try and show him a demo of what he needed.
I've been searching for a structural valid xhtml/css option to vertically align a block element for quite a while know. The dead centre example seems to work but when you change the doctype to xhtml 1.0 strict you will notice that ie 5+ mac will render the page incorrect. I know this browser is outdated but sometimes you really need your site to align weel across all major browsers and platforms.
Comments
David Dorward
Oh wow! Its possible! I thought it impossible!
... and it is - at least if you don't want it to break horribly when the user changes their font size.
Posted by: David Dorward | January 14, 2004 03:49 PM
thijs
I've been searching for a structural valid xhtml/css option to vertically align a block element for quite a while know. The dead centre example seems to work but when you change the doctype to xhtml 1.0 strict you will notice that ie 5+ mac will render the page incorrect. I know this browser is outdated but sometimes you really need your site to align weel across all major browsers and platforms.
Posted by: thijs | August 6, 2005 06:02 AM