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

Jenny Suh
Jenny Suh
200 Points

help with .main-pg set to paragraph class

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

    <p> <h1 class=".main-pg"</h1>

   My amazing website</p>

<p> class=".main-pg"{


2 Answers

Steven Parker
Steven Parker
187,498 Points

You've got the class part right, but you have parts of another element there also (h1). The class setting should go right after the "p" inside the "<p>" tag :point_right: <p class=".main-pg">

And nothing goes yet on the "styles.css" tab. When it does, the syntax will be different.

When creating a class for an HTML element make sure to leave out the '.' when defining the class so for example:

You're asking to have the .main-pg set to paragraph class so it should be <p class="main-pg"> and not <p class=".main-pg">

And then when you're creating a declaration on the CSS style sheet to refer to the class you created you don't need to include the carrots.

To refer to a class element you simply just need to put the '.' to refer to any class created.

So it would be .main-pg

Steven Parker
Steven Parker
187,498 Points

Jenny Suh — Glad to help. You can mark a question solved by choosing a "best answer".
And happy coding!