Bootstrap 中未设置 z-index
z-index not setting in Bootstrap
我正在使用 bootstrap,我有一个弹出的模式,它工作得很好,只有 .modal-dialog
的 z-index 为 0,即使它确实设置了。 .modal-backdrop.n
的 z-index
为 1030,它工作得很好,所以 .modal-dialog
被放置 in/under 黑色背景。
有人知道这里到底发生了什么以及如何解决吗?
非常感谢!
我很清楚这样的事情z-index parent/child relationship
简单Bootstrap模态Fiddle
编辑
我从 v3.0.0 升级了 bootstrap 版本 --> v3.3.2,现在一切正常。只是为了显示与最新版本保持同步。感谢大家的帮助!
z-index
仅适用于 position
ed 元素。因此设置 position: relative;
、position: absolute;
或 position: fixed;
。
- 请尽可能不要使用
!important
!
Answer Source 来自 sandeep。
我正在使用 bootstrap,我有一个弹出的模式,它工作得很好,只有 .modal-dialog
的 z-index 为 0,即使它确实设置了。 .modal-backdrop.n
的 z-index
为 1030,它工作得很好,所以 .modal-dialog
被放置 in/under 黑色背景。
有人知道这里到底发生了什么以及如何解决吗?
非常感谢!
我很清楚这样的事情z-index parent/child relationship
简单Bootstrap模态Fiddle
编辑
我从 v3.0.0 升级了 bootstrap 版本 --> v3.3.2,现在一切正常。只是为了显示与最新版本保持同步。感谢大家的帮助!
z-index
仅适用于 position
ed 元素。因此设置 position: relative;
、position: absolute;
或 position: fixed;
。
- 请尽可能不要使用
!important
!
Answer Source 来自 sandeep。