Calculating CSS 2.1 selector specificity

When an element is matched by the selectors of several CSS rules, the most specific selector wins and the declarations in the corresponding rule are applied. That makes sense, but sometimes figuring out which selector is most specific can be tricky. Fortunately reading Andy Clarke’s CSS: Specificity Wars and Molly E. Holzschlag’s CSS2 and CSS2.1 Specificity Clarified will help you understand how selector specificity works and how to calculate it.

  • October 8, 2005
  • Comments closed
  • Posted in

Comments

1. October 11, 2005 by Mats Lindblad

And if your a Star Wars fan, Andy's article will put a BIG smile on your face. :D

Sorry, comments are closed for this post.

Information, sponsorship, and externals

About the author

Roger Johansson is a Swedish web professional specialising in web standards, accessibility, and usability. More about me and this site.

Subscribe

Looking for web hosting?

Try DreamHost!

Use the promo code 456BEREASTREET3 to save USD 20 when you sign up!

Latest articles

Validation statistics from Nikita the Spider Comments off
An analysis of the sites crawled by the bulk validation tool Nikita the Spider during March 2008.
Authentic Jobs API and Affiliates program Comments off
The Authentic Jobs job listing service now has a public API and an affiliate program.
What does Acid3 mean to you and me? Comments off
Opera and Apple have announced that their web browsers pass the Acid3 Browser Test, but how will that help web designers and developers?
Designing Web Navigation (Book review) Comments off
Learn the fundamentals of navigation design and design better navigation systems for large and small sites as well as for web based applications.
DOMAssistant bundle for TextMate Comments off
To save keystrokes and speed up development I have created a DOMAssistant bundle for TextMate.
First impressions of Internet Explorer 8 Beta 1 Comments off
My impressions after trying out Internet Explorer 8 Beta 1 for a couple of days.

More articles

Favourites, here and elsewhere

Affiliation

  • NetRelations
  • Kaffesnobben
  • Dagens recept
  • 9rules network member

Support this site

Show your support by buying a book or two from SitePoint or getting me something from my Amazon Wish List.