View Full Version : center a layer and nesting layer help needed?

17 Feb 2007, 04:41 AM
hi guys.

i just wanted to create a web page with centralized layers in dreamweaver. so i googled and found the following css which will do the needfull

center layers with css (http://bluerobot.com/web/css/center1.html)

but unfortunately i couldnt nest anyother layers after i added this CSS and the centered layer with this css is not shown in the layers window too..if anyone can help me with it please??

or is there is any other method to do my needs much better :rolleyes:

17 Feb 2007, 05:44 AM
The link says
This box is horizontally centered by setting its right and left margin widths to "auto". This is the preferred way to accomplish horizontal centering with CSS, and works very well in most browsers with CSS2 support. Unfortunately, IE5/Win does not respond to this method - a shortcoming of that browser, not the technique.

The work-around is for IE5 which is long out of date and I don't expect many computers have it now. Do you know that many of your viewers are using very old computers? If not I suggest you ignore the work-around.

Carry on using the margin: auto method which needs a div width for it to work.

Or use width: 600px; left: 50%; margin-left: -300px; you need to set the width to suit your page but note that the margin-left is always half the div width.