正如标题所述,两者之间是否存在性能差异
*[data-some-id='XX'] {
...
}
对比
[data-some-id='XX'] {
...
}
最佳答案
Per specs , 它们是一样的。
Unless an element is featureless, the presence of a universal selector has no effect on whether the element matches the selector.
Note: In some cases, adding a universal selector can make a selector easier to read, even though it has no effect on the matching behavior.[...]
强调我的
关于css - *[data-some-id ='XX' ] 和 [data-some-id ='XX' ] 在性能方面有区别吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55447723/