-
Book Overview & Buying
-
Table Of Contents
Web Developer's Reference Guide
By :
Combinators are used to select more complex structures. They can help target specific elements or groups of elements that would be difficult to target otherwise.
This selector specifies that an element must be contained by another element.
The combinator is the whitespace character. We are explicitly defining it here so that it is clear:
selector-a selector-b
The two or more statements used in this selector can be any valid selector statement. For example, the first could be a class selector followed by a type selector. The distance between the selectors does not matter. Each intermediate element will not have to be listed for the selector to work.
The combinator can be stacked. Each statement will have a whitespace character around it. This list of selectors does not need to be all inclusive, but for the selector to match the hierarchy, it does need to exist.
This selector is best used when you only want to style elements in certain situations. The...
Change the font size
Change margin width
Change background colour