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 trialLoren Cardella
Python Web Development Techdegree Student 8,096 PointsCSS Color Tag
I can't use the color tag for some reason.
<body>
<style>
{
h1 [
color: green;
]
}
</style>
<h1>Nick Pettit</h1>
</body>
2 Answers
Samuel Webb
25,370 PointsIt's because you're using square braces [ ] when you should be using curly braces { }
Loren Cardella
Python Web Development Techdegree Student 8,096 PointsThe exercise immediately before this one forced me to put the h1 tag in curly braces. Doing it your way let me complete this exercise, but only after: 1) Putting h1 in curly braces in the previous exercise 2) Deleting the curly braces in the current exercise 3) Adding curly braces around color: green;
Samuel Webb
25,370 PointsNot sure which part is making you use square braces. I didn't see anything.
First part:
<!-- Add style tags above h1 -->
<body>
<style></style>
<h1>Nick Pettit</h1>
</body>
Second part:
<!-- Select the h1 element -->
<body>
<style>
h1 {}
</style>
<h1>Nick Pettit</h1>
</body>
Step threee:
<!-- Set h1 color green -->
<body>
<style>
h1 {color: green}
</style>
<h1>Nick Pettit</h1>
</body>
Samuel Webb
25,370 PointsSamuel Webb
25,370 PointsAlso, the
h1
as a whole shouldn't be between curly braces. Code should look like this: