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

CSS

always same fault///you need to set the border color for <p> element ???????

styles.css

.main-pg { <p> border:4px wide solid red</p>;

}

3 Answers

Thank you so much Matthew, I tried several times your option, and the same answer: please help

Q. Give the paragraph a border that is 4px wide, solid and red. fault Bummer! You need to set the border color for <p> elements to red. Restart

Thank you

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

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

you are so Right, I would like to give you the mark, because, this question doesn't work but the answer you gave me is correct. Could you please ask a teatcher? (I have no point)

I'm not positive on what challenge this is for so giving you the the correct answer will be difficult.

However, with your css you have some major issues. You don't use the HTML element <p> in your selection. You would simply select the <p> tag like the following:

p {
  border: 4px solid red;
}

Also, the "wide" keyword that you used is incorrect syntax for the border property. The border property you're trying to use is shorthand for the following three properties:

p {
  border-width: 4px;
  border-style: solid;
  border-color: red;
}

which is equivalent to:

p {
  border: 4px solid red;
}

Also, the class that you had, main-pg is where I'll have trouble giving you the correct answer. If the question wants you to give the border to this class then it would look like the following:

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

Hopefully this clears things up. If not, please show us the challenge, or full question, you're on.

I was able to google which question you were stuck on now that I had more to go on.

First, the challenge wants you to add the class main-pg to the paragraph tag:

<!doctype html>
<html>
  <head>
    <link href="styles.css" rel="stylesheet">
  </head>
  <body>
    <p class="main-pg">My amazing website</p>
  </body>
</html>

Next it wants you to select this class in your css and give it the border styles we discussed before:

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

Sorry for taking so long to get you to the solution but it can be difficult when we don’t know the question and don’t have enough to go on. In the future you can post your question directly on the page with the challenge. That way all we have to do is click view challenge to know exactly what you’re talking about.

Happy coding!

Here's what worked for me...

I'm sure you have already figured this out but I thought I would comment for anyone with the same problem moving forward. I had the same issue and tried a few things before it finally accepted my answer. What I did was, create a new rule. So, just as you created the rule for "main-pg" in css. Create one for the paragraph.

p {

border: 4px solid red;

}

"being wrong is the first step to being right"

you can't learn how to fix something if it never breaks... right? :)

Good luck!