[thelist] centering absolute CSS sites in the browser?

Andy Budd andy at message.uk.com
Mon Aug 23 04:05:59 CDT 2004


pete wrote:

> Does anyone have any good article links, tips, or warnings about  
> trying to dynamically (or pseudo-dynamically, via browser detection)  
> center web content when the content it built using CSS absolute  
> positioning instead of tables?

Are we talking vertically or horizontally?

Is there a reason why you have to use absolute positioning?

It's very easy to horizontally centre a block level element in CSS.

http://www.andybudd.com/archives/2004/02/ 
css_crib_sheet_3_centering_a_div/index.php

And here are a couple of vertical centring methods

http://www.hicksdesign.co.uk/journal/30/vertical-centering-with-css
http://vmalek.murphy.cz/
http://www.student.oulu.fi/~laurirai/www/css/middle/

Straight from the wiki

http://css-discuss.incutio.com/?page=CenteringBlockElement

Oh, and with these type of questions, you can often find the answer  
with a bit of googling.


Andy Budd

http://www.message.uk.com/



More information about the thelist mailing list