Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

corey smith
Courses Plus Student 406 Pointswhat am i doing wrong
how do i set the <p> to red?
<!doctype html>
<html>
<head>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<p class="main-pg" >My amazing website</p>
</body>
</html>
p .main-pg {
border-color: 4px solid and red;
}
3 Answers

Jack Spangenberg
643 PointsSince you added the main-pg
class to your paragraph, there is no need to specify that it is a paragraph in your CSS and you don't need to say and
in your CSS.
Also, You need to use border-style
too.
.main-pg {
border-style: 4px solid;
border-color: red;
}

Ari Misha
19,286 PointsHiya Corey! Just remove "and" and "p" from your css , coz you have already selected ".main_pg" class which is a reference to the "p" tag. Also it should be just "border" . Here is the code for the reference:
.main-pg {
border: 4px solid red;
}

Jason Anders
Treehouse Moderator 145,692 PointsHey Corey,
First, you don't need to specify the tag when selecting by class or id. So, you just need the main-pg
.
You are on the right track with your rule, except for 2 things:
- To set the border, you use
border
. - You don't include an
and
in the parameter list.
So, once all is corrected, the CSS will look like this:
.main-pg {
border: 4px solid red;
}
Hope that helps. :)
Frank Torchia
18,346 PointsFrank Torchia
18,346 PointsTo add onto Jack's answer, you can also use the shorthand style for your borders if you'd like.
You just have to change...
border-color: 4px solid and red;
To this...
border: 4px solid red;
Notice how I changed
border-color
toborder
? Usingborder
lets you specify multiple border attributes all at once.