我希望在响应式图片的顶部放置一个按钮,但不在中心位置,并且我希望它保持在图像中另一个按钮的相同位置。这是我的代码 jsfiddle:
这是HTML:
我希望当调整浏览器大小时,
这是HTML:
<div class="container">
<div class="img">
<img src="http://www.playful.ma/wp-content/uploads/2017/02/img.png" class="0">
</div>
<div class="overlay">
<h4>My Button</h4>
</div>
这是 CSS
.container{
width: 100%;
}
.overlay{
position:absolute;
top:70%;
left:60%;
padding:10px;
background:white;
border-radius:10px;
}
.img{
position:relative;
width:100%;
min-width: 100%;
}
我希望当调整浏览器大小时,
.overlay
div仍保持在图像中蓝色按钮的上方位置。
谢谢。