Click to See Complete Forum and Search --> : Centering a multiple LAYER layout (???)


mark4man
12-30-2006, 11:49 AM
'nother Dreamweaver question...

All of my web page layouts are accomplished via Layers...using kind of a WYSIWYG approach to position boxes of images & text where I need them to be on the page.

For the pages I have done in an 800 pixel wide size, those layers are always positioned to the left on a bigger screen; & I now want those multiple layer layouts to slide over to the center (in any browser window.)

I obviously can't do this by applying the CENTER tag to all layers, since I need them to retain their position relationship to each other...

...so...

1) Can I place my Layers layout in a Table; & center position the entire table ?

2) Can the Body somehow be centered...since the layers reside in the body?

Thanks in advance for any help,

mark4man
Dreamweaver MX (6.0)


BTW - Thanks Tyree for your help on my last post...you were absolutely right. I accomplished what I wanted to do by laying out the page in Illustrator (to be at least comfortable with image resizing)...then I exported the entire page as a big .TIF, opened that in Photoshop, comitted the background to it's own layer & washed out the opacity 50% (& then saved it as a JPG for the web.) MySpace Music allows customization by permitting additional code entries at the bottom of the user's Bio section, so I added the new image as a background image using CSS.

ryanbutler
12-30-2006, 05:58 PM
If you have a container DIV which nests the rest of your DIV's in your layout, then set the container DIV's left and right margins to auto:

#container{
margin:0 auto;
}

mark4man
12-30-2006, 06:12 PM
Ryan...

How would I know if I have that (?)...when I laid out these pages I never used a parent layer (meaning a large layer that I then placed all the other layers into)...I just placed individual layers left to right, top to bottom...to create the design.

Is this something I can do after the fact?

Thanks,

mark4man

ryanbutler
12-31-2006, 01:15 PM
It reads as though you have fallen victim to what Dreamweaver calls layers. Layers are absolutely positioned elements which are taken out of the normal flow of a document. When you have multiple absolutely positioned elements, the layout become increasing difficult to manage and predict in behavior.

Without seeing the layout the only thing I can suggest is setting the left coordinate of all the layers to the same value, but that probably won't work.

mark4man
01-06-2007, 12:02 PM
Ryan...

I solved it (w/ the help of a friend in another forum.) As a referrence, I created a test page on my server...& created a large container ("Layer 1")...nested Layers 2, 3 & 4 within Layer 1...& wanted Layer 1 to slide to the center of any browser window, with 2,3 & 4 not changing absolute position relative to Layer 1 (which was the original problem/goal.) The solution was:

<div id="Layer1" style="position:relative; width:285px; height:311px; margin: 0 auto;">
<div id="Layer2" style="position:absolute; width:47px; height:115px; z-index:1; left: 226px; top: 120px;"><img src="layer2.jpg" width="58" height="133"></div>
<div id="Layer3" style="position:absolute; width:131px; height:115px; z-index:2; left: 3px; top: 3px;"><img src="layer3.jpg" width="158" height="189"></div>
<div id="Layer4" style="position:absolute; width:176px; height:71px; z-index:3; left: 94px; top: 130px;">;"><img src="layer4.jpg" width="158" height="189"></div>
</div>

[w/ divs 2, 3 & 4 tabbed (inset) two spaces to define nesting]

where the container (Layer 1) was assigned relative positioning & centered by auto margins...& the nested layers (2,3 & 4) remained absolute; & inline

...but...

...he also tells me that inline styles are not a good idea.

Everybody tells me that inline styles are not a good idea (& I think you were illuding to that in your reply.)

But no one tells me why.

So...3 questions:

1) Why are inline styles not a good idea...& is that relative (pardon the pun) to the way I am now centering my layer layout?

2) Is there a way to configure Dreamweaver to write layer code (i.e., user draws in the layer...Dreamweaver writes the code) other than inline?

3) On all of my existing page layouts that consist of multiple layers (each one housing an image or text)...that I now want centered...how do I now nest those layers in a large container layer? (the above centering solution was from a test page I created from scratch, w the subsequent layers being nested as I went, as noted. I now need to go back to existing pages & center the layout.)



Oh, man!

Thanks very much,

[b]mark4man
Dreamweaver MX (6.0)