Summary 3

Stylin' with CSS Chapter 2


Multiple selectors can be grouped

If you have the same properties for multiple tags like h1 and h2, instead of repeating them you can group them. By separating h1 and h2 by a comma and then list the shared properties.


Pseudo-class

There are two groups of pseudo-classes the user interface which causes rules to be applied when the html elements are in a certain state like a link or visited. The other group is structural which applies the rules when certain structural relationships exist like last-child or first-letter.


Specialized contextual selector

With specialized contextual selector you can select elements based on either their tag name, immediate parent, or its preceding sibling. The child selector is with > sign between the tags, the adjacent siblings selector with + sign, the general siblings selector is with the ~ sign, and the * sign is used for the universal selector.