Seeing this email reminded me of something.

Yes, some CSS properties are inherited and some aren't.

Inheritance depends on *specificity*, which can be reduced to a mathematical formula, as in this quote from the definitive O'Reilly book by Eric Meyer, where it says:

  H1 {color: red;}                    /* specificity = 1 */
  P EM {color: purple;}               /* specificity = 2 */
  .grape {color: purple;}             /* specificity = 10 */
  P.bright {color: yellow;}           /* specificity = 11 */
  P.bright EM.dark {color: brown;}    /* specificity = 22 */
  #id216 {color: blue;}               /* specificity = 100 */

which makes sense.

However, I know I've read an article also by Eric, which says that those nice numbers which make so much sense at first glance are not in base ten.

I'm sure it was in his own personal website, but I can't seem to find it. I remember being puzzled by it at the time. If not base 10, then what? Hex? So a specificity of 11 is actually seventeen? And 17 is actually 23? Maybe I misinterpreted something?

I'd appreciate any light members could shed on this,

jh
------------------------------------------------------------
               "Have You Validated Your Code?"
John Horner                            (+612 / 02) 9333 2110
Senior Developer, ABC Online          http://www.abc.net.au/
------------------------------------------------------------

******************************************************
The discussion list for  http://webstandardsgroup.org/

Proud presenters of Web Essentials 04 http://we04.com/
Web standards, accessibility, inspiration, knowledge
To be held in Sydney, September 30 and October 1, 2004

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to