Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Layers are being offset in Dreamweaver

Status
Not open for further replies.

Ito2233

MIS
Sep 2, 2003
77
US
Let's say I have an image of a rectangle on my page. Then I create a layer with the same dimensions of that rectangle, and position it exactly above the rectangle. I use Dreamweaver to create that layer and to make it visible only when the mouse cursor moves over the rectangle image.

When I preview this in a browser, the layer is the same size as my rectangle image (which is what I desired), and the layer becomes visible when the mouse cursor moves over the rectangle. When it becomes visible, however it is offset to the left and to the top of the rectangle image. Why is that, and how do I solve that problem?

Thanks
 
In what browser? Did you set the margin properties of the <body> tag? Is the layer positioned relative or absolute? What does the source code look like?

Sorry to ask so many questions P-)

haslo@haslo.ch - www.haslo.ch​
 
DW does not always give the same position as the browser in the case of a layer, u may have to shift it a bit in DW...

Known is handfull, Unknown is worldfull
 
My browser is Internet Exploder 6.0.
I do not have margins set for my BODY tag. I'm not too familiar with BODY margins. I'm assuming all content in the body has an automatic margin? Still, my rectangle image and its corresponding layer are not left aligned...they're more towards the middle of the page.
The layer is absolute-positioned.

Thanks
 
Hm, can you post your source?

You can always try with the following:

Code:
<body topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" marginwidth="0" marginheight="0">

Having all those parameters is necessary if you want it to work in IE and Mozilla.

On the other hand, if you place the main content in a layer as well, you can place it much easier as well, and you're (pretty) sure it will look the same in all browsers. I'd suggest trying that.

haslo@haslo.ch - www.haslo.ch​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top