[thelist] Trying to center using CSS

Amy Johnson amy at rocky-hills.com
Sun Aug 11 23:37:00 CDT 2002


I am creating my first tableless site using CSS.  In general, I think it is going ok.  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.

Below is some of my CSS code.  DIV.main is meant to be the entire screen.  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?

Thanks!
Amy


DIV.main        {background-color: black;
                position: absolute;
                height: 700;
                width: 100%;
                top: 0px;
                bottom: 0px;
                left: 0px;
                right: 0px;
                text-align: center;
                }

DIV.ht          {position: absolute;
                height: 550px;
                width: 600px;
                top: 70px;
                left:  auto;
                }





More information about the thelist mailing list