Not sure what I'm getting wrong!

I thought that I needed to add the font-family into the style class, but that didn’t work. What am I doing wrong?!

  **Your code so far**

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

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

<h2 class="red-text">CatPhotoApp</h2>
<main>
<p class="red-text">Click here to view more <a href="#">cat photos</a>.</p>

<a href="#"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" alt="A cute orange cat lying on its back."></a>

<div>
  <p class="red-text">Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p class="red-text">Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
</div>

<form action="https://freecatphotoapp.com/submit-cat-photo">
  <label><input type="radio" name="indoor-outdoor" checked> Indoor</label>
  <label><input type="radio" name="indoor-outdoor"> Outdoor</label><br>
  <label><input type="checkbox" name="personality" checked> Loving</label>
  <label><input type="checkbox" name="personality"> Lazy</label>
  <label><input type="checkbox" name="personality"> Energetic</label><br>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>
</form>
</main>
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0

Challenge: Set the Font Family of an Element

Link to the challenge:

Two things:

  1. You added the class “red-text” to all the p elements. Why did you do that? That is causing the tests to fail.
  2. It would make more sense to just add the font-family to the existing p element in the style section. That does not break the test, but would make more sense.

When I fix that first one, the code passes for me.

  1. That was already in the code
  2. That’s what I did first and it didn’t work

But I took your advice and deleted it, and the code worked.

I’m a bit confused about why the code was in there in the first place? Just to be deleted?

Yeah, I don’t get it. If I reset the code and do it right it works. There must be some subtle change that got made by accident. I wouldn’t worry about it.

Thank you for your help. I’m realising that learning to code will take some patience!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.