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

Ruby Wallace
Ruby Wallace
160 Points

Set the border color for <p> element

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

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
class =  .main-pg { 
<p >styles: bordercolor: red; property:  border-radius:4px;
  }
Ruby Wallace
Ruby Wallace
160 Points

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

2 Answers

Steven Parker
Steven Parker
176,321 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.

Ruby Wallace
Ruby Wallace
160 Points

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
176,321 Points

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

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