Forums

This topic is locked

Default Layer Writing Question

Posted 06 Jan 2007 19:51:53
1
has voted
06 Jan 2007 19:51:53 Mark Forman posted:
<b>People...</b>

An internet friend of mine in another forum helped me solve a parent (container) layer centering problem. I had created a large "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. The solution was:

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

[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.

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 nest those layers in a large container layer? (the above centering solution was from a test page I created from scratch...& the subsequent layers were nested as I went. I now need to go back to existing pages & center the layout.)

Thanks very much,

<b>mark4man</b>
Dreamweaver MX (6.0)

Reply to this topic