Bootstrap 3: 我试图将按钮中心漂浮在面板页脚的中间。但是整个布局都是响应式的,所以我需要在屏幕尺寸调整大小时使用它,或者它仍然是正确的。 我创建了一个bootply,我的尝试很接近,但在屏幕调整大小时不会停留。 谢谢, 内特
答案 0 :(得分:6)
这是你想要的吗? http://www.bootply.com/114327
.relative {
position: relative;
}
.absolute {
position: absolute;
}
.bottom-btn {
left: 50%;
bottom: -17px; /* half of the button height */
margin-left: -77px; /* half of the button width */
/* instead of bottom and margin-left, you can use translateX as well. */
}
使用css position
属性并使用margin
获取准确位置。查看.bottom-btn
类的评论。