【发布时间】:2018-01-05 02:15:49
【问题描述】:
这就是我想要实现的目标:
位于两个单独的 div 标签之间的图像,例如 facebook 个人资料页面:
我在这里搜索,但解决方案没有多大帮助。它按我想要的方式定位,但由于它是引导程序并且它应该响应,当屏幕尺寸减小时,图像位置会改变,这是我不想要的。
这是代码(可能不合适,因为我只是在测试) -
HTML -
<div class="container">
<div class="jumbotron jumbo" id="custjumbo">
<h1>This is a jumbotron... </h1>
<h2>Let's see what can we make of it..</h2>
<br>
<img src="images/tiger.jpg" class="img-thumbnail" alt="Tiger"
width="304" height="236">
</div>
</div>
CSS -
.container {
background-color: cadetblue;
}
.jumbo {
margin-top:20px;
position: relative;
}
.img-thumbnail {
position: absolute;
bottom: -60px;
right: 200px;
}
img {
display: block;
width: 200px;
height: 200px;
background: green;
}
这就是我所追求的:
【问题讨论】:
标签: html twitter-bootstrap image css positioning