我有两个跨度:
<span id="top" ><img src="top.png" /></span>
<span id="bottom" ><img src="bottom.png" /></span>
我怎样才能把它放在哪里:
- 顶部图像重叠在底部图像上
- 确保顶部图像显示在底部图像的前面)(而不是在它后面)
- 确保对齐方式在浏览器之间保持一致
最佳答案
@哦;你可以给你的跨度 position:relative
因为 z-index
只适用于 position absolute & relative
就像这样:
CSS:
span{position:relative;display:block}
#top{z-index:1;}
#bottom{margin-top:-20px}
html:
<span id="top" ><img src="top.png" /></span>
<span id="bottom" ><img src="bottom.png" /></span>
关于jquery - 在所有浏览器的 html 页面上,让一张图片与另一张图片重叠的最佳方式是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7446939/