Does anyone have information on browser selector speeds in CSS? In other words, how different selectors compare to each other (in th same browser).
For example, I often see (and write) code like this:
#content #elem { ...rules... }
But since those elements are unique IDs, I should only need #elem
, right? This got me thinking about whether maybe it's quicker for browsers to have more complex selectors - my thinking being that a browser might find #content
and know to only look in that element, no where else.
Another example might be table tr td .class
vs table .class