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 trialRinke van Zanden
983 Pointsh1 color
Hey there, I can't figure out what I'm f'in up here..
"<body> <style type="text/css"> .h1:{ color: #00ff00; }
</style>
<h1>Nick Pettit</h1>
</body>
5 Answers
Richard Duncan
5,568 PointsYou don't need a period before an element selector in CSS. Your rule would imply that you are adding that color to a class of .h1 rather than the element h1.
You also need to drop the : from after the element selector. Correct syntax illustrated below.
h1 {
}
Rinke van Zanden
983 Points<body> <style> h1: { color: green; } </style> <h1>Nick Pettit</h1> </body>
Rinke van Zanden
983 PointsWhen I take out the period it still doesn't work...
Richard Duncan
5,568 PointsUpdated my answer to include the correct syntax. Hope this helps.
Jan Van Raemdonck
22,961 Pointsyou have to take out the period before and the colon after the h1
Rinke van Zanden
983 PointsThanks! That worked.