Use a CSS Class to Style an Element.... I stuck here...plz anyone give the correct form

Tell us what’s happening:

Your code so far

<style>
  h2 {
    color: blue;
  }
</style>

<h2>CatPhotoApp</h2>

<p>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>

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Linux; Android 7.0; SM-G610F Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/use-a-css-class-to-style-an-element

What part of the instructions do you not understand?

google font import… that I cant pass

It’s not working. every time, i include the link and run the programme, the p tag is losing its own font-family

This challenge has nothing to do with importing google fonts. The challenge you linked from is called Use a CSS Class to Style an Element.

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/<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;}
h2{font-family: Lobster;}  
</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 class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>css">
<style>
  .red-text {
    color: red;
  }
p{font-size: 16px;
    font-family: Monospace;}
h2{font-family: Lobster;}  
</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 class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

this is my code

What is the challenge name you are working on with this code?

import a google font

Next time, link from the challenge you are having trouble.

The instructions said to copy the following code snippet into the code editor.

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

Instead, you copied the following:

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

Also, it appears like you copied parts of the original code and pasted them in other parts of the code. My recommendation is to click the Reset your code button to start over and follow the instructions exactly.

ok… I am reseting… I will let u know

thanks a lot… after reset I pass… I hope in futyre u will help me

I am glad you were able to pass. I am going to sleep (12:30 AM here in California), but there is always someone willing to answer a question on the forum.

ok… but can I knock u if I stuck anywhere

I am from Bangladesh… its 2:35pm here… I am new here… my very much wish is to be a web developer… I really need some useful suggestion

1 Like

So keep going, don’t give up and remember that You should learn from your mistakes :slight_smile:

I stuck here…Add Borders Around your Elements