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 trialWilfredo Casas
6,174 PointsWhy is my css not working?
For some reason my css is not working, but it seems good to me
<!doctype html>
<html>
<head>
<link href="styles.css" rel="stylesheet">
</head>
<body>
<p class = "main-pg">My amazing website</p>
</body>
</html>
.main-pg {
border: 4px, solid, red;
}
2 Answers
Samuel Glister
12,471 PointsHi Wilfredo,
Pay close attention to when you write out you class attributes, it looks like you have put a space before the '='
Your link should look like this (assuming the css file is in the same as the index.html).
<p class="main-pg">hello world</p>
I hope this helps.
edit - I have also noticed on your css that you have commas between each part of your statement it doesn't need this like below
.main-pg {
border: 4px solid red;
}
Maximillian Fox
Courses Plus Student 9,236 PointsYou have
.main-pg {
border: 4px, solid, red;
}
Just remove the commas
.main-pg {
border: 4px solid red;
}