[thelist] Trying to center using CSS

David Bindel dbindel at austin.rr.com
Mon Aug 12 00:10:01 CDT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> -----Original Message-----
> From: Amy Johnson
>
> I have embedded DIVS set up and am able to
> center things as I need to.  However, I can't center the primary
> DIV.  I would like it to center within different size screens, 17",
> 19", 21", etc.
>
> DIV.ht contains all of my web page.  So I want for
> DIV.ht, which is a set width, to always be centered in DIV.main.
> I don't think percentages will work for the left value of DIV.ht
> since it is a fixed width.  But left:auto doesn't work either.
> This seems like it should be obvious.  What am I missing?
>
> DIV.ht          {position: absolute;
>                 height: 550px;
>                 width: 600px;
>                 top: 70px;
>                 left:  auto;
>                 }


The CSS you need is as follows:

div.ht {
	width: 600px;
	height: 550px;
	margin-left: auto;
	margin-right: auto;
}

HTH,
David Bindel
-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0.4

iQA/AwUBPVdC47wc2umqeOxSEQKBsACfW5uwmYpiAh1wB7hg3vPJk2XWgDkAnRQk
dJHCKns1ikh9/VNMNEagwFEt
=eCCg
-----END PGP SIGNATURE-----




More information about the thelist mailing list