Bootstrap3浮动按钮面板底部

cla*_*p49 3 twitter-bootstrap-3

Bootstrap 3:我试图将一个按钮中心浮动到面板页脚的中间.但是整个布局都是响应式的,所以我需要在屏幕尺寸调整大小时使用它,或者它仍然是正确的.我创建了一个bootply,我的尝试很接近,但是在屏幕调整大小时不会停留.谢谢,Nate

Bootply试用版

Rav*_*lya 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. */
}
Run Code Online (Sandbox Code Playgroud)

玩css position属性并margin用来获得准确的位置.看到.bottom-btn班级的评论.