【发布时间】:2015-05-12 03:23:08
【问题描述】:
将 bootstrap3 与 mvc5 结合使用。
使用网格系统,我连续有 4 个(“col-md-3”)。这是一个盒子的 HTML:
<div class="col-md-3">
<div class="index-box">
<h2>Other Reports</h2>
<p>Click this button to go to the report index page.</p>
<button class="big-button">View Reports</button>
</div>
</div>
在全屏模式下,按钮很好地位于框中,但是当我在移动设备上查看时,框是堆叠的(应该如此),但按钮宽度变为全屏的百分比,而不是 .index-box .这是当前的 css:
.index-box {
border: 1px #527f03 solid;
border-radius: 5px;
text-align: center;
padding-bottom: 20px;
height: 250px;
max-width: 260px;
}
.index-box h2 {
position: relative;
top: -25px;
background-color: #dfece2;
display: inline-block;
}
.big-button {
position: absolute;
margin-left: -35%;
left: 50%;
width: 70%;
max-width: 70%;
bottom: 20px;
background: #9cc64e;
padding: 5px 10px;
color: #23423a;
font-size: 18px;
text-decoration: none;
}
它在移动屏幕宽度上的外观:
【问题讨论】:
-
这很可能是您对按钮的绝对定位。
标签: css twitter-bootstrap responsive-design