Having issues with 'Import a Google font'

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">

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

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

<h2 {font-family:Lobster;}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://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>

<div>
  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>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>

Challenge: Import a Google Font

Link to the challenge:

My challenge: The assignment is to use an element selector to set Lobster as the the family for h2 element.
This is how I understood and wrote my solution:

<h2 {font-family: Lobster;} class="red-text">CatPhotoApp</h2>

When I submitted, it was not correct saying ‘your h2 element should use the font Lobster’. I would like to know where I’m wrong, please.

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

Learning to describe problems is an important part of learning how to code.

Also, the more information you give us, the more likely we are to be able to help.

Instead of inline css you should define the font inside the style tag. As shown below

<h2 {font-family: Lobster;} class="red-text">CatPhotoApp</h2>

<style>
  .red-text {
    color: red;
  }
  h2 {
    font-family: "here will be your choice of font style";
  }
  p {
    font-size: 16px;
    font-family: monospace;
  }
</style>

I hope this will help ya…

1 Like

It worked!!! I’m very excited. Thank you so much.

No prob Gini. Keep going :muscle:

1 Like

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