Home

CSS Rules and Selectors

The HTML

<div id='intro'>
  <p class='first'>This is a <em>
    paragraph.</em>
  </p>
  <p>
    This is the second paragraph.
  </p>
  </div>
  <p class='first'>
    This is not in the intro section.
  </p>
  <p>
    The second paragraph is not in the intro section.
  </p>

The CSS

#intro .first em
{
  color: pink;
  background-color:gray;
}

Result

This is a paragraph.

This is the second paragraph.

The second paragraph is not in the intro section.