* * CSS选择器是什么? [英] What does the * * CSS selector do?
问题描述
最近,我在 CSS 中遇到了 * *
。
网站参考 - Site Link 。
在CSS样式表,互联网和堆栈溢出中使用单个 *
充满了例子,但我不确定在CSS中使用两个 * *
符号。
For a single *
usage in CSS style sheet, Internet and Stack Overflow is flooded with examples, but I am not sure about using two * *
symbol in CSS.
我googled它,但无法找到任何相关的信息,因为单个 *
选择所有的元素,但我不知道为什么网站使用它两次。
I googled it, but unable to find any relevant information about this, as a single *
selects all elements, but I am not sure why the site used it twice. What is the missing part for this, and why is this hack used (if it is a hack)?
推荐答案
就像任何一个其他时候你一个接一个(例如 li a
),你得到后代组合器。因此, * *
是任何其他元素的后代的任何元素 - 换句话说,不是整个文档。
Just like any other time you put two selectors one after another (for example li a
), you get the descendant combinator. So * *
is any element that is a descendant of any other element — in other words, any element that isn't the root element of the whole document.
这篇关于* * CSS选择器是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!