HTML Introduction to HTML and CSS Make It Beautiful With CSS Test: Styling by Element and Class

Can anyone tell me what I'm doing wrong?

I keep writing this rule and the error message still shows

index.html
<!doctype html>
<html>
  <head>

   <p class="main-pg">My amazing website</p> 
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>

    <p>My amazing website</p>

</body>

</html>
class=".main-pg"
styles.css

2 Answers

Hey Lynn, I commented on your last question, but your class declaration belongs within you <p> tag. You also dont need a "." in the class when declaring it, only when referencing it in CSS/JavaScript. Here is what challenge step 1 should look like:

<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>

    <p class="main-pg">My amazing website</p>

  </body>
</html>

Step 2:

.main-pg {

}

And finally the paragraph styles in step 3:

.main-pg {
    border: 4px solid red;
}

Good luck, and keept at it!

Dylan

But where does it go??????????

Where in the document does it go???? Before the body tag?

This should be the only thing inside your index.html.

<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>

    <p class="main-pg">My amazing website</p>

  </body>
</html>

<p class="main-pg">My amazing website</p>

that is where the class is being referenced

These both go inside styles.css for their respective steps. Nothing else should be in there

Step 2:

.main-pg {

}

And finally the paragraph styles in step 3:

.main-pg {
    border: 4px solid red;
}