Link to home
Start Free TrialLog in
Avatar of meetpd
meetpdFlag for India

asked on

How to use efficient CSS selectors?

Hi,

When I run the YSlow tool, it shows me below classes with very inefficient rules.

What am I suppose to do with those classes?

Please help.
* .menu li.current a    
Tag key with 2 descendant selectors and Class overly qualified with tag

* .menu li.current a b    
Tag key with 3 descendant selectors and Class overly qualified with tag

Open in new window

Avatar of remorina
remorina
Flag of Australia image

Is there a specific reason for using wildcards (*)?
the inefficiency is being detected because of the asterix.

Try removing it or using the ID or class of the menu parent

For example #wrapper .menu li.current a b

Check this link for more info http://code.google.com/speed/page-speed/docs/rendering.html
Avatar of meetpd

ASKER

Actually there is no * in the class. But in Yslow it shows with asterisk.  I added #wrapperDashbd as suggested, but it now shows:

#wrapperDashbd .menu li.current a    
Tag key with 3 descendant selectors and Class overly qualified with tag

And yes, I have gone through that link..but being a beginner I am unable to understand it fully.

What should I do now?
ASKER CERTIFIED SOLUTION
Avatar of remorina
remorina
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial