General Rule: You want to be as specific as it makes sense to be. If some styling isn't applied to an element, check the specificity.
- Inline Styles
An inline style lives within your HTML document. It is attached directly to the element to be styled.
<h1 style="color: #fff;">
- IDs
#id_name{}
-
Classes, Attributes, and Pseudo-classes
Classes:
.class_name{}
Attributes:
span[lang]{}
Pseudo-class:
a:hover{}
a:focus{}
-
Elements and Pseudo-elements
Elements:
p{}
h3{}
Pseudo-elements:
:before{}
:after{}
Specificity is actually a value attributed to each CSS selector. Read about it here
Resources:
Great presentation. Speak up though.
Thanks, Stephen