更新时间:2023-01-05 12:53:49
CSS选择器是因此,.videoContainer
应该比#dialog .videoContainer
更快",因为它错过了对#dialog
的测试.
Therefore, .videoContainer
should be "faster" than #dialog .videoContainer
because it misses out testing for #dialog
.
但是,这些充其量都是无关紧要的-您永远不会注意到它们之间的区别.对于正常大小的页面,我们谈论的时间太少了,甚至根本不存在.
However, this is all irrelevant at best - you'll never notice the difference. For normally sized pages, the amount of time we're talking about is so insignificant as to be nonexistent.
以下是专家的相关答案,您应该阅读:为什么浏览器从右到左匹配CSS选择器?
Here's a relevant answer by an expert that you should read: Why do browsers match CSS selectors from right to left?