HTML Introduction to HTML and CSS 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
195,719 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
195,719 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!