Exposing element outside modal-backdrop in CSS Bootstrap jquery modal

≯℡__Kan透↙ 提交于 2019-12-06 01:08:56

It would be great if you have a fiddle to show your code in a way that we can run it and see what's going on.

You will need to include the position of the element, for a z-index to take effect:

#outside-element {
   position: relative;
   z-index: 1041;
}

The .modal-backdrop has a z-index of 1040, but the .modal itself (#help-box) has a z-index of 1050, so if your outside element needs to be in front of the backdrop and in front of the dialog, you'll have to give it a z-index of 1051 rather than 1041.

If it only needs to be in front of the backdrop, but will not be overlapping with the dialog, then a z-index of 1041 should work, but, as @uapuap mentioned, you'll also need to give it a position, like position: relative.

Here's a fiddle showing it working, with the outside element in front of the backdrop only, with a z-index of 1041 and position: relative:

http://jsfiddle.net/fgyja20w/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!