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 4 px wide solid red

The paragraph has a class attribute of "main-pg". I've been trying to set the Border like this in CSS but it's not working

.main-pg {border: 4px solid red } I've even tried this .p {border:4px solid red } And still nothing. What am I doing wrong?

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 4pxsolidred
}










p.solid {border-style:co

2 Answers

Martin Safar
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Martin Safar
Front End Web Development Techdegree Graduate 30,972 Points

Hi, based on the CSS screenshot you included it looks like you just forgot to put spaces between the CSS values and also make sure you end every CSS declaration (each line inside {}) with a semicolon ;

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

Have a nice day and happy coding! :)

Dennis Eitner
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Dennis Eitner
Full Stack JavaScript Techdegree Graduate 25,644 Points
<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
    <style media="screen">
      p.main-pg{
        border: 4px solid red; 
      }
    </style>
  </head>

  <body>


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

  </body>
</html>
    ```