我的主容器有相对位置,我想要将两个图像叠加在一起。
当我把绝对位置加到我的一个div中时,它就消失了。
我尝试使用定位左上角,右上角等。我附加了图像,它应该是如何看起来。
How it suppose to look
下面是我的代码
<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>有什么建议吗?
发布于 2015-10-18 17:28:56
您忘记了,所以请指定绝对div的宽度。在css中添加width: 100%。
发布于 2015-10-18 17:27:15
使用
width:100%因为具有绝对位置的图像将绝对解决您的问题;)
您可以免费使用这里的小提琴^^
http://jsfiddle.net/sxbo705L/1/
https://stackoverflow.com/questions/33196285
复制相似问题