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 trialBrandon Schneider
2,123 Pointscan someone tell me how I can make my paragraph a red color and a solid font with a border of 4px please.
please help
<!doctype html>
<html>
<head>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<p class="main-pg">My amazing website</p>
</body>
</html>
.main-pg{
text-align: center;
}
main-pg{
border: 4px
border color: red
border element: solid
}
2 Answers
Jamie Reardon
Treehouse Project ReviewerHi, good answer Michael however you are also missing a syntax punctuation on your code as well.
For the correct result, try this code.
.main-pg {
border: 4px solid red;
}
Michael Cook
Full Stack JavaScript Techdegree Graduate 28,975 PointsHey Brandon, there are a few things syntactically incorrect with your code. I wouldn't be alarmed by this though. As you go on through this basic course you do other HTML and CSS courses, you will type so many lines of HTML and CSS that the proper syntax will become second nature. Try this:
.main-pg{
border: 4px solid red;
}
When you are working with the border
property in CSS, you can specify all the aspects of the border in a single line like above. You could also specify aspects of your border individually, but why bother when there is a convenient single-line way of doing it? If you want to read about the border
property you can here: https://developer.mozilla.org/en-US/docs/Web/CSS/border
Good luck!
Michael Cook
Full Stack JavaScript Techdegree Graduate 28,975 PointsMichael Cook
Full Stack JavaScript Techdegree Graduate 28,975 PointsRight you are. I didn't add the period before the class name.