Browsers read your CSS selectors right to left.

May 30, 2010

Right to Left

One of the important things to understand about how browsers read your CSS selectors, is that they read them from right to left. That means that in the selector ul > li a[title="home"] the first thing thing interpreted is a[title="home"]. This first part is also referred to as the “key selector” in that ultimately, it is the element being selected.

via Efficiently Rendering CSS | CSS-Tricks.

{ 1 comment… read it below or add one }

true March 17, 2011 at 11:01 am

your absolutely right, but unfortunately almost no-one on the interwebs knows this.
everyone use it in the wrong way. don’t know how much faster sites will be if people use css the right way.
for more info, check Google’s Steve Souders video http://www.youtube.com/watch?v=aJGC0JSlpPE
the css part is starting around the 23th minute.

Reply

Leave a Comment

Previous post:

Next post: