View Full Version : Yet another CSS layer centering problem...

03-07-2006, 04:10 AM
Hi everyone - first post, and feeling very lucky I found this forum!
I'm a dreamweaver newb, and have a question I haven't seen answered yet on this forum.
I'm trying to create a CSS layout with a main centered layer (600X800px), that contais several other layers. I figured out how to center the main layer, but the problem is that no matter what I try the other layers that need to be contained in the main one (and stay at an exact position relative to it), either stay in the same place (if their position is absolute) or move at a different ratio from the main layer when the browser is resized (if positioned relatively).
I tried nesting the layers, but their position is still not relative to the parent layer, but rather to the page itself (or their location in the html code).
Is there a solution for this?
Thanks in advance for any replies!

03-07-2006, 12:01 PM
Redwood have read this

hope this will clear the concept!

03-07-2006, 02:06 PM
Yes I have - that's how I found this site...
Maybe I'm not understanding something, but it only helped me center the main layer. The other layers that need to be `inside` the main layer at fixed positions, don't work.
Depending on how I set them up they either stay completely fixed in place regardless of browser resize, or they move independently at a different ratio from the main layer when I resize the browser window.
The problem as far as I understand it is that I only want the main layer to be centered on the page relative to the sides of the browser, the other layers need to be fixed in place inside the main layer. If I put them inside the `wrapper` their position becomes related to the edges of the browser, and they move independently from the main layer.
Hope there's a solution for this...

03-08-2006, 12:59 PM
Please post your code.
You cannot absolutely position a layer in a centered page, you will have to use nested layers with floats to put them appx where you want them.

Take a look at the original template I made for our anniversary (link on front page) and see how I position the header, navigation, content & footer. This may give you an idea of how to proceed.


03-08-2006, 10:47 PM
Thanks Mike.
I didn't find the link to the aniversary template on the home page, but you're coinfirming for me what I suspected - the layout I want can't be done in CSS.
Looks like I'll have to use a sliced image...
It would be really nice if you could make a child layer's position relative to the parent layer's edges (ie refer to the parent layer as the refference to the child's position, making the upper left corner of the parent 0,0).
That way (in theory at least) you could create a main layer that was centered, containing absolutely positioned (in the main layer) child layers.
One could wish...

03-09-2006, 04:04 AM

Location of template.