|
The adjacent selector is represented by a plus (+) sign. This allows you to apply a style to a tag that immediately follows another tag. For example: h1 + p {color: blue;} This example means that any time a <p> is the first tag after an <h1> tag, the paragraph is in blue. Other paragraphs are normal. You can combine this selector with other types of selector. For example: h1.first + p {color: blue;} This example means that that any time a paragraph is the first tag after an <h1> tag with the class first, the paragraph is in blue. Other paragraphs are normal. |
More information Use the class attribute as a selector Use the id attribute as a selector Adjacent selectors Matching attributes and selectors Pseudo classes and elements as selectors |