我的主容器有相对位置,我想将 2 个图像相互叠加。
当我将绝对位置添加到我的一个 div 时,它就消失了。
我尝试使用左上角右上角等定位方式。我附上了图片的外观。
这是我的代码
<div style="position: relative;">
<div style="background: url('http://i.imgsafe.org/8797eaa.png') no-repeat; background-size: 100% auto; height: 709px;margin-top: 70px"></div>
<div style="background: url('http://i.imgsafe.org/8ab6260.png') no-repeat; background-size: 100% auto; height: 170px;position: absolute; top:0; left: 0"></div>
</div>
有什么建议吗?
最佳答案
关于css - 为什么 CSS 位置绝对图像不显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33196285/