我正在使用 Angular 2 开发 Web 应用程序。单击按钮时,我试图打开弹出窗口。我可以用 JavaScript 来完成。我现在正在尝试使用 Angular 2。
下面是我在主页中弹出的 HTML 代码。
<button id="myBtn">Open Modal</button>
<!-- The Modal -->
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<span class="close">×</span>
<p>Some text in the Modal..</p>
</div>
</div>
在主页面我有一个文本框。当我在弹出文本框中打开弹出窗口时,也显示如下。
过滤记录文本框在 html 页面中,而不是在弹出窗口中。有人可以帮我解决这个问题吗?谢谢。
最佳答案
听起来您对过滤记录文本框和按钮应用了高 z-index
; z-index
是一个样式属性,允许您通过降低“过滤记录”文本框/按钮上的 z-index
来指定哪些内容出现在其他人面前应该位于弹出窗口后面。
在此处阅读有关 z-index
的更多信息:https://www.w3schools.com/cssref/pr_pos_z-index.asp
关于css - 如何从弹出窗口中删除背景控件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49424056/