为什么CSS定位绝对图像不';你不来吗?
我的主容器具有相对位置,我想将两个图像叠加在一起 当我将绝对位置添加到我的一个div时,它就消失了 我试图使用定位左上右等我附加的图像如何它应该看起来 这是我的密码为什么CSS定位绝对图像不';你不来吗?,css,Css,我的主容器具有相对位置,我想将两个图像叠加在一起 当我将绝对位置添加到我的一个div时,它就消失了 我试图使用定位左上右等我附加的图像如何它应该看起来 这是我的密码 <div style="position: relative;"> <div style="background: url('http://i.imgsafe.org/8797eaa.png') no-repeat; background-size: 100% auto; height: 709px;
<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>
有什么建议吗 使用
width:100%
因为拥有绝对位置的图像绝对可以解决您的问题;)
这是你的免费小提琴^^
您忘了指定绝对div的宽度。在css中添加
宽度:100%