FCC Challenge 13: Set the Font Family of an Element

For FCC Challenge 13 we need to set the font family for the p elements:

<style>
  .red-text {
    color: red;
  }

  p {
    font-size: 16px;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

The updated code should look like:

<style>
  .red-text {
    color: red;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p>Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

You can set an element’s font by using the font-family property.

For example, if you wanted to set your h2 element’s font to Sans-serif, you would use the following CSS:

h2 {
  font-family: Sans-serif;
}

Make all of your p elements use the Monospace font.

Leave a Comment





This site uses Akismet to reduce spam. Learn how your comment data is processed.