rak*_*los 8 html css twitter-bootstrap
这个问题似乎已经在github上多次询问过,但我没有遇到任何解决方案:https: //github.com/twitter/bootstrap/issues/1399
如何在小屏幕上正确垂直对齐模态?
编辑:从 Bootstrap 2.0.2 开始,这不再是问题。基本上,bootstrap 现在实现了下面提出的解决方案,我将其留在这里以供参考。
通常,在小屏幕上,模态框将填充大部分窗口,因此相对于触发模态框的按钮进行定位并没有多大意义。我通常做的只是覆盖手机的模态位置:
@media (max-width: 767px) {
.modal {
top: 20px;
// negative left margin to position horizontally.
margin: 0 0 0 -280px;
// already in modals.less, just copied for clarification:
left: 50%;
position: fixed;
}
}
Run Code Online (Sandbox Code Playgroud)
(这在 LESS 中,纯 CSS 解决方案看起来类似)。
| 归档时间: |
|
| 查看次数: |
1786 次 |
| 最近记录: |