Specificity


show more Specificity provides you with in-depth training on Web. Taught by Eric Meyer as part of the CSS Web Site Design show less
please wait ...

Specificity

In this video we're going to talk about specificity, which in a lot of ways is the heart of conflict resolution in CSS, and the easiest way to sort of approach the subject is to say, suppose that I have two rules that absolutely conflict, I said I want my list items, my li elements to have a background of red, but then, I also said that I want the level background of green and I can't have both, I mean it would be cool if CSS would just sort of strike them together, candy cane style, but it doesn't. The list items have to have either a red background or a green background.

Which one is it going to be, the answer as it turns out is green. But the question asked is why, you might say to yourself, well, because green came later, but suppose that I said this, I said body li background red, but then I said li background green. The green came second, but the red looks like it might be, I don't know, a little more specific perhaps. So which one do you think it is, red or green. ...

Specificity
Video duration: 8m 20s 6h 8m Intermediate

Viewers:

Specificity provides you with in-depth training on Web. Taught by Eric Meyer as part of the CSS Web Site Design

Subject:
Web
Software:
CSS
Author:
please wait ...