如何单击:: before元素 [英] How to click on ::before element
问题描述
我必须关闭此对话框
相同的HTML代码是
如何处理.没有其他选择可关闭对话框. 我已经尝试过通过CSS选择器来定位元素,但是那有帮助.
How to deal with it. There is no other option to close the dialog box. I have tried locating element via css selector but that dint help.
修改 ngdialog-close:before
Edit CSS of ngdialog-close:before
.ngdialog.ngdialog-theme-default .ngdialog-close:before {
background: transparent;
border-radius: 3px;
color: #bbb;
content: '\00D7';
font-size: 26px;
font-weight: 400;
height: 30px;
line-height: 26px;
position: absolute;
right: 3px;
text-align: center;
top: 3px;
width: 30px;
}
推荐答案
您不能单击::before
,因为它不是元素,它可能是内容(如果该元素比某人在幕后进行了不良做法). Chrome出于调试目的将其显示为::before
.所以我认为这可能是其中之一:
You can't click the ::before
as it is not an element, it's probably content (If it is an element than someone used bad practices behind the scenes). Chrome displays it as ::before
for debugging purposes. So I think it could be one of these:
- 您的关闭按钮不是按钮,而是图标或gif等...
- 您错过了可能是
div
的实际按钮,但是例如在单击之前需要将鼠标悬停,否则它是您的div
的父元素. - 您的按钮不起作用...(它可以手动工作吗?)
- Either your close button isn't a button but an icon or a gif etc...
- You're missing the actual button which could be the
div
but it requires a hover before the click for example or it's a parent element to yourdiv
. - Your button isn't working... (does it work manually?)
如果发现它是一个元素,则可以在打开Chrome开发工具的情况下单击它,然后查看样式标签显示的内容,例如:
If it turns out it is an element, then you can click it with Chrome dev tools opened and see what the Styles tab is showing, for example:
div::before {
content: url(some.gif);
}
也许它会向您显示正在添加的HTML代码.
Perhaps it will show you the HTML code that's being added.
这篇关于如何单击:: before元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!