Selectors

TODO: explain type selectors.

Any HTML element can be a type selector. This is global as any CSS applied to a particular element would be applied to all occurances of that element. Type selectors can comprise of article, header, h1, nav and so on.

TODO: explain class selectors.

A class can be applied to many occurances of a particular element. It is said that the element belongs to that class. This is know as a class selector. For example, the class highlight has been used several times and a selector would select all of the elements with a class value, highlight allowing for a common set of CSS rules to be applied to the whole selection of elements.

TODO: explain id selectors.

The id attribute is used on various elements. For example, the section id="combine_selector" element can be uniquely selected as it's id has a uniques value, combine_selector. This is known as an id selector. This unique value, combine_selector can be used as an address in a hyperlink, or a selector for CSS styling or applying Javascript behaviour.

TODO: explain psuedo selectors.

A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected element(s). Basically a pseudo-class is a selector that assists in the selection of something that cannot be expressed by a simple selector. For example, :hover can be used to change a button's color when the user's pointer hovers over it.

TODO: explain selector combination based on the DOM relationship.

Selectors can also be combined, for example footer > h1 selects only the h1 element that is the child of the footer element.section.highlight > h1 selects only the h1 element that is the child of the section element that are of class type highlight.