|
If you want to define a style that only applies if a tag is nested inside another tag (such as bold text inside a paragraph tag), you can use contextual selectors. The CSS2 specification refers to these selectors as descendant selectors. A contextual or descendant selector is a series of selectors separated by a space, such as: p b {color: blue;} In this example, bold text in a paragraph appears in blue. Any other text is unaffected:
|
More information Use the class attribute as a selector Use the id attribute as a selector Nesting selectors Matching attributes and selectors Pseudo classes and elements as selectors |