"Layers" are absolutely positioned <div> tags. Being absolutely positioned
means that it sits a certain number of pixels to the right of and below the
left and top margins of its parent (positioned) element - in this case, the
body tag. It's clear that such a scheme will not allow 'layers' to move
along with a centering image.
If you want your 'layers' to be centering as well, so that they track the
image, you can do this in a number of ways. The very best way (in my
opinion) would be to use CSS positioning.
1. Wrap the 'layer' *and* the image in a container div that has a defined
width, and auto settings for left and right margins, e.g. (inline styles
shown only for clarity - these should be positioned using a stylesheet) -
<div id="wrapper" style="width:760px; top:0; margin:0 auto;
position:relative;">
<div id="layer1" style="width:200px; top: 25px; left:140px;
position:absolute;">blah</div>
<img>
</div>
Now, in DW's Design view, position the 'layer' so that it has the proper
orientation to the image. When the browser viewport changes width, the
wrapper div will reposition, and this will carrry the 'layer' and the image
to a new location in lockstep, so that they are always aligned as desired.
2. Visit PVII - http://www.projectseven.com/ - and get the SNAPLayer
extension. This will allow you to use client-side javascript to align the
'layer' and the image, so that they are always positioned relatively to each
other.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver MX
(If you *MUST* email me, don't LAUGH when you do so!)
==================
news://forums.macromedia.com/macromedia.dreamweaver - THE BEST WAY TO GET
ANSWERS
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================
"firestarter_mx" <webforumsuser (AT) macromedia (DOT) com> wrote
Quote:
Hey ,
I have a centered image that i am placing layers on top of. However when
I
open the browser to check the page the layers are in the wrong place. Is
there
anyway that i can resize the browser window and keep the layers in the
postion
stated in DW.
Thanks in advance.
Lee |