【发布时间】:2017-11-16 10:55:43
【问题描述】:
我需要在使用 Bootstrap 网格的容器底部放置一个元素。
我遇到的问题是锚点超出了父宽度。我需要锚点跨越 100% 并保持在父 div content-wrapper 的宽度内。
我需要在来自父容器的按钮的每一侧保留 15 像素的填充。
这是问题的截图:
HTML:
<div class="content-wrapper col-xs-12">
<div class="content">
<a class="button" href="#">See more</a>
</div>
</div>
CSS:
.content-wrapper {
width: 100%;
height: 450px;
background-color: gray;
position: relative;
}
.button {
display: block;
background: black;
width: 100%;
text-align: center;
height: 50px;
padding-top: 13px;
position: absolute;
bottom: 0;
}
这里是JSFIDDLE 以查看实际问题。
【问题讨论】:
-
Bootstrap 在两边添加 15px 的边距,尝试在 boostrap 之后加载自定义 css,使用
!important还是将margin固定为 0
标签: html css twitter-bootstrap responsive