Hi,

I've built an html page with a backgroung htm file. On top of that I have put a layer, so that the layer can be modified when the content changes.

The problem is that every different computer screen (all different widths) I look at, the layer moves around and isn't anchored in the same spot.

You can see this at www.southlanddreamer.com and click on Builder's Corner, for example.

What's the solution to this problem ? Thank you for your help, Margie

  • Did you actually write this code or did something automatically generate it for you? Nathan Duran over 6 years ago
  • layers are a Dreamweaver 'feature' danwellman over 6 years ago

1 answer

Doug 1095
0
points
This was chosen as the best answer

The "layers" you mention are actually a table that is centered on the page and another table inside a div that uses position:absolute to position it above the first table. The div is positioned with left:500px.

Think about that for a moment: one of your layers is always centered, the other is always 500px from the left. Of course they're not going to line up correctly!

Here's the easy answer: Change the CSS for the div to:

left:50%;
margin-left:-100px;

The "50%" puts the left edge of the div right in the middle of the screen, and therefore in the middle of your background layer. The negative margin-left moves the div towards the left; play with this number until you get the div right where you want it.

[I call that the easy answer and not the right answer, because the right answer involves scrapping your layout tables and spacer GIFs completely, ordering your content logically and semantically, and building the CSS on top of that.]

Answered over 6 years ago by Doug
  • I think the right answer is "hire someone else to do this for you." None of that is going to make any sense to a person who's just clicking buttons in Dreamweaver. Nathan Duran over 6 years ago
  • Thank you Doug, for your answer. Your explanation was very clear and understandable. Much appreciated, Margie Margie Samuels over 6 years ago