Hello Mike521266,
Your containing div, #container, needs to be
position: relative; so your absolute positioned elements stay with their container.
You also have #Layer2 set at
width:409px;height:263px; but the image in it is much bigger at
width:451px;height:335px;
I prefer putting a background color on divs for testing. If you use a border you stand a good chance of inadvertantly wrecking your
box model.
Try some of these changes to your CSS -
Code:
body {
text-align: center;
background: #fc6;
}
#container {
margin: 0 auto 0 auto;
width: 1000px;
height:1000px;
text-align: left;
background: #ff0;
position: relative;
}
#Layer1 {
position:absolute;
width:17px;
height:12px;
z-index:1;
left: 492px;
top: 22px;
background: #00f;
}
#Layer2 {
position:absolute;
width:451px;
height:335px;
z-index:2;
left: 20px;
top: 21px;
}
#Layer3 {
position:absolute;
width:16px;
height:11px;
z-index:3;
left: 979px;
top: 22px;
background: #ccc;
}
It's really too bad DreamWeaver seems to steer new coders toward using absolute positioning. Have a quick read on the
Pitfalls of AP.
It would be much better to float all your divs instead.
Like this -
Code:
body {
text-align: center;
background: #fc6;
}
#container {
margin: 0 auto 0 auto;
width: 1000px;
/*height:1000px;*/
overflow: auto; /*to clear the floats*/
text-align: left;
background: #ff0;
}
#Layer1 {
width: 150px;
/*height:12px;*/
float: left;
background: #00f;
}
#Layer2 {
width:451px;
float: left;
}
#Layer3 {
width:250px;
float: left;
background: #ccc;
}
And last, when posting code in the forum, please use the code tags, [code][/code] - available with the # button in the post edit window.
This will wrap your code in a scroll box which greatly helps the readability of your post.