0
好吧我遇到了一个小问题,在DIV中定位图像。定位基于一个DIV在另一个DIV内的图像
<div id="wholePage">
<img src="theImages/header_shadow_flip.png" id="hF" />
<div id="pageWrapper"><img src="theImages/header_shadow.png" id="bF" />
</div>
</div>
我有两个的DIV
#wholePage {
position: relative;
width: 1000px;
padding: 0 10px;
padding-top: 35px;
margin: 0 auto;
}
#pageWrapper {
position: relative;
width: 960px;
padding: 0 10px;
padding-top: 37px;
margin: 0 auto;
}
为顶部阴影,这只是正常的CSS以下CSS。没有必要改变,就是:
img#hF {
position: absolute;
left: 50px;
top: 56px;
z-index:2;
}
但底部页脚图像是给我发出和CSS是:
页面img#bF {
position: absolute;
left: 50px;
top: 1657px;
z-index:2;
}
两个例子如下:
www.interfaithmedical.com/CheckSite/index.html
www.interfaithmedical.com/CheckSite/ms_gynecology.html
如何对齐底部阴影图像以匹配pageWrapper DIV,使其位于其正下方?并不像第二个链接那样基于页面本身进行定位。 (在第二个链接,你可以看到它使用了原来的间距和超出页面内容)
你不应该在你的例子中使用无效标记,因为它可能会导致混淆。 – Daedalus
这只是我解决这个问题。我计划为将来的编辑提供有意义的名称。感谢您的反馈也一样。 – Interfaith