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

Peter Chukwukelu
PLUS
Peter Chukwukelu
Courses Plus Student 833 Points

To give a paragraph a border of 4px solid and red color

To give a paragraph a border of 4px solid and red color

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
    {
    border width: 4px solid;
    color: red;
    }
Haydn Ellen
seal-mask
.a{fill-rule:evenodd;}techdegree
Haydn Ellen
Python Development Techdegree Student 22,243 Points

You are almost there! You have specified color as red, however that will make the paragraph text red and not the border, you just need to add the color property to the actual border itself. And you have the border property slightly wrong, you should be looking along the lines of border: 4px solid ???; and the question marks are where you need to put the color.

1 Answer

Steven Parker
Steven Parker
231,236 Points

CSS properties don't have spaces in their names. And the shorthand property that lets you set all the values for a border at once is just simply "border".

And with that property, you can set the size, style, and color all on the same line.

Peter Chukwukelu
Peter Chukwukelu
Courses Plus Student 833 Points

Thank you so much @Haydn and @Steven. I really appreciate.