下面:is() https://developer.mozilla.org/en-US/docs/Web/CSS/:is用法不适用于伪元素,有人可以解释吗?
<!DOCTYPE html>
<html lang="zh-Hans">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Test</title>
<link rel="stylesheet" href="https://unpkg.com/normalize.css" />
<style>
body {
background: #000;
color: #eee;
}
button::before {
content: 'foo';
}
/* ???? not working */
:is(button::before) {
content: none;
}
/* ???? not working either */
button:is(::before) {
content: none;
}
</style>
</head>
<body>
<button>Test</button>
</body>
</html>
Pseudo-elements cannot be represented by the matches-any pseudo-class; they are not valid within :is(). ref https://drafts.csswg.org/selectors-4/#matches
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)