【发布时间】:2016-04-11 05:53:15
【问题描述】:
我在具有绝对位置的容器上方有两个具有绝对位置的按钮。看起来不错,但是当我调整窗口大小时,按钮一个一个显示。如果margin小于10px,如何使第二个按钮转到下一行?
这是我的 HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<link href="one/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<div id="map-canvas" class="jumbotron" style="position: relative"></div>
<div class="jumbotron" style="position: relative"></div>
<div style="position: absolute; top: 65%;">
<a href="two/index.html" class="btn btn-default btn-lg" style="margin: 30px;">Two Explorers</a>
</div>
<div style="position: absolute; top: 65%">
<a href="one/index.html" class="btn btn-default btn-lg" style="margin: 30px;display:block ">One Explorer</a>
</div>
<div id="overlay" style="height: 50%;display: table;">
<div class="container" style="display: table-cell;vertical-align: middle;width:100%; text-align: center">
<h1>The Demo of The Band to the Pole</h1>
<h3>Select the version you want to see</h3>
</div>
</div>
</body>
</html>
它基于 CSS 的 Bootstrap。我添加了这个ID:
#map-canvas {
height: 100vh;
position: relative;
margin:0px;
background: transparent no-repeat 1 1;
}
#overlay {
top:0px;
background: #fff;
opacity: .8;
position: absolute;
padding: 10px;
margin: auto;
width: 100%;
}
【问题讨论】:
标签: html css twitter-bootstrap twitter-bootstrap-3