The display you see in Firefox is the correct implementation of vertical margin collapse, which IE gets wrong completely. If you are spacing an element within a container, the most stable way is to use padding on the container rather than margins on the element. Keep margin for spacing elements on the same "level". Also remember that any paddings applied to a container will need to be subtracted from its height. The gap you see under the inner image in IE is due to the paragraph height being added to by the padding set in different units - assign the padding in pixels and account for this measurement in the width and height.
Code:
body
{
margin: 0;
padding: 0;
text-align: center;
width: 100%;
}
.wrap
{
width: 675px;
margin: auto;
padding: 100px 0 0;
position: relative;
}
.firstlayer
{
background-image: url('450berries1.jpg');
width: 675px;
height: 273px;
margin: 0 auto;
position: relative;
padding: 54px 0 0;
}
.secondlayer
{
background-image: url('450berries2.jpg');
width: 450px;
height: 191px;
border: solid 2px black;
margin: 0 auto;
padding: 27px 0 0;
}
.thirdlayer
{
width: 330px;
height: 164px;
border: solid 2px black;
background: white;
margin: 0 auto;
}
.thirdlayer img
{
float: left;
}
.thirdlayer p
{
display: inline;
text-align: left;
float: right;
width: 130px;
height: 144px;
padding: 10px;
}
Bookmarks