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

I am failing to understand the question and also to answer it

in the css file, create a rule for the .main-pg class. You don't need to write any style instructions yet.

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

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

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

3 Answers

Piotr Manczak
Piotr Manczak
Front End Web Development Techdegree Student 16,879 Points

in HTML as follows: <p class="main-pg">My amazing website</p>

AND is CSS:

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

Brendan Whiting
MOD
Brendan Whiting
Front End Web Development Treehouse Moderator 84,109 Points

I don't want to give away the answer. Here is some documentation on the CSS class selector.

  • the dot should be right next to the class name, no space
  • the class name shouldn't be in quotes
  • you need to open a block with curly braces {}
  • you don't need the class keyword here

Thank you for the much clearer explanations

The .main doesn't need {} borders or brackets does it? Cause the video shows it in the workspaces.