centering layers

A

ATV

I read a post very similar to this question and tried to implement but really
wrecked the page!

I also bought a template and have figured out how to center it. But when it
is centered the layers remain fixed. The post I read was "position layers in
tables." The website, if anyone can help, is
www.atlantathundervolleyball.com. I knew NOTHING about websites three weeks
ago -- obviously there are HUGE holes in my understanding. Still tweeking
it.. so don't laugh too hard
 
M

Murray

Centering absolutely positioned elements is pretty simple.

One needs to understand a bit of CSS to do it however. The tough concept is
the one that says an absolutely positioned elements takes its 0, 0
coordinates from the position of its closest positioned parent. This means
that if you put a layer into a layer, the inner layer will be offset from
the outer layer's position, not from the upper left-hand corner of the page.
It also means that if we wrap the entire page in something that is BOTH
centering *and* positioned, that all layers on the page will now take their
position from the wrapper, not the upper left-hand corner. Here's how -

Add this CSS to the page -

body { text-align:center; } /* this is for IE5/5.5 */
#wrapper { text-align:left; width:760px; margin:0 auto; position:relative; }
/* this is the positioned outer container */

And place a div with that ID around the entire page, e.g.,

change this -

<body...>

to this -

<body ...>
<div id="wrapper">

and this -

</body>

to this -

</div><!-- /wrapper -->
</body>

and see what happens.
 
A

ATV

When I combined the body html with the css comand from the other post; it
worked great. THANK YOU SO MUCH!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top