[thelist] Thought I'd try making a site with CSS... (>_<)

Dave Stevens dave at stemfiction.com
Sun Feb 29 10:59:15 CST 2004

Christian Anderson wrote:

>Hi Brian,
>Thanks for all the tips. I went ahead and made all the changes that you
>suggested, and its almost got it to where it should be.
>Though, its no longer centered in either browser, the photo gallery and
>moblog little boxes aren't lining up with each other, and then travelogue is
>still overlapping those two :(
>Anything that I missed?
the way I've always centred stuff (and I got this idea by frequently 
visiting mezzoblue.com, Dave Shea is a master!) is by having a container 
div (I believe your <div class="white"> fits the bill for this) that has 
its left and right margins set to auto, and putting "text-align: 
center;" in your body css. Then of course you will need to put 
"text-align: left;" in your css for paragraphs, or divs if you don't use 
paragraphs for text (which you should really).

so, to summarise, your css should contain this (amongst your existing css):

body {text-align: center;}

p {text-align: left;}

.white {margin-left: auto;
          margin-right: auto;

I'm not claiming this is the best/right/etc way to do this, just a way 
that has worked for me.


More information about the thelist mailing list