Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

Give the paragraph a border that is 4px wide, solid and red. Bummer! You need to set the border color for <p> elem

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

this program never pass with the error message above?

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
p .main-pg {
  border: 4px solid red;
}

3 Answers

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

You don't have to add the 'p' to the class selector. try the code above. Good luck.

HIDAYATULLAH ARGHANDABI
HIDAYATULLAH ARGHANDABI
21,058 Points

if you put the paragraph p element then no need for the class. It is correct any how but the tree house work spaces are programmed according to real world problem so please remove the class selector

Dave StSomeWhere
Dave StSomeWhere
19,870 Points

It is because you are using a Descendant combinator and it is looking for an element with the class of .main-pg that is a descendant of a <p> element.

Why are you specifying a class?

hello Dave, Many thanks for your help!

I think you are right but my programming doesn't work out ?? What do you advise me?