Is the CSS star selector considered harmful (and why)?

When it comes to performance, Steve Souders is the man:

  • Performance Impact of CSS Selectors
  • Simplifying CSS Selectors

Shameless quote from one of the reports:

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.

[bold emphasis mine]

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)