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

Set the border color for <p> element

Struggling with setting border color in CSS.. working on it for long time. Thanks

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

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

class =  .main-pg { 
<p >styles: bordercolor: red; property:  border-radius:4px;

Thanks had everything written but property, it wasn't clear enough in video.

2 Answers

Steven Parker
Steven Parker
229,005 Points

There's a few syntax issues with the CSS:

  • putting a period in front of a class name identifies it, you don't use the word "class"
  • the settings inside the CSS rule block are styles, but the word "styles:" is not used
  • part of each setting is a property name, but the word "property:" is also not used
  • CSS code will not contain complete HTML tags (like "<p>")
  • the property name "border-color" should have a hyphen

Also, this challenge doesn't ask for a "border-radius" to be set. But some of the border properties still need settings.

Exactly, it did ask for border-radius of 4 and property did not work, so I just stopped because I ended up losing work on the screen before it. At that point I know I needed a break! Lol!

Steven Parker
Steven Parker
229,005 Points

Curious — I ran through the challenge and didn't see "border-radius" in the instructions.

But glad I could help, Ruby Wallace. You can mark a question solved by choosing a "best answer".
And happy coding!