解决方法
当谈到性能,史蒂夫·苏德斯是男人:
> Performance Impact of CSS Selectors
> Simplifying CSS Selectors
无耻的报价从其中一个报告:
The key to optimizing CSS selectors is
to focus on the rightmost selector,
also called the key selector
(coincidence?). Here’s a much more
expensive selector: A.class0007 * {}.
Although this selector might look
simpler,it’s more expensive for the
browser to match. Because the browser
moves right to left,it starts by
checking all the elements that match
the key selector,“*“. This means the
browser must try to match this
selector against all elements in the
page.
[大胆强调我]