H2 CSS selector

Tell us what’s happening:

It keeps saying I haven’t used an h2 CSS selector to change the font. I thought I had and it looks like I have in the preview and now can’t figure it out.

Your code so far


<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .Lobster {
font-family: Lobster
}
  .red-text {
    color: red;
  }

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

<h2 class="Lobster">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="/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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-css/import-a-google-font

The error message is right because instead of a h2 selector, you have used a class instead. What you need to do is to change the lobster class in the style to be a h2 selector (look at how the p is styled for a hint) and remove the class in the h2 element. The element will then be:

<h2>CatPhotoApp</h2>

You also need a semicolon at the end of css lines:

font-family: Lobster;

Hope this helps :slight_smile:

3 Likes

Thank you so much for your help! :smiley:

2 Likes

Thanks Alot . i was stuck in this last couple of days

1 Like

did you miss the semi-colon after the font description Lobster?

1 Like

Ive got the same issue ,where its telling me that the only thing wrong with my markup is that i haven’t used a CSS selector.

but from the beginning I’ve had: h2 {font family: Lobster}

I’ve tried making it inline, using classes, and checked my cases. idk if its a bug or if im oblivious .

1 Like

of course Im oblivious …

good ol’ semi-colons .

sorry for accusing you of bugs freecodecamp hah

p {
font-size: 16px;
font-family: monospace ;
}
h2 {
font-family: Lobster; }
<h2 class=“red-text”

1 Like