Types of Selectors
GROUP SELECTORS
CSS formatting rules can also be set up in groups like this:
h1, h2, h3, h4, h5, h6 {color: #F1CD33;}
This rule would make all headings the color #F1CD33 in one fell swoop.
DESCENDENT SELECTORS
To be more specific with your CSS designs, you can use descendent selectors. These let you format tags differently when they appear inside certain other tags. For example, you can create a CSS style that looks like this:
h1 a {font-family: arial; color: red;}
This rule would make all anchor tags that appear within an h1 tag be in arial font and red. Any anchor tags not in an h1 tag wouldn't follow this rule.
CSS formatting rules can also be set up in groups like this:
h1, h2, h3, h4, h5, h6 {color: #F1CD33;}
This rule would make all headings the color #F1CD33 in one fell swoop.
DESCENDENT SELECTORS
To be more specific with your CSS designs, you can use descendent selectors. These let you format tags differently when they appear inside certain other tags. For example, you can create a CSS style that looks like this:
h1 a {font-family: arial; color: red;}
This rule would make all anchor tags that appear within an h1 tag be in arial font and red. Any anchor tags not in an h1 tag wouldn't follow this rule.