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 trialChun Yin Chan
303 Pointshow to change the text color?
Why i can not change my text color?
<style>
.h1{
color: #000000;
}
</style>
<h1>Nick Pettit</h1>
2 Answers
Abe Layee
8,378 PointsYou want to set the color to green not black. Also, remove the dot before the h1. We use dot on element with class name.
<body>
<style>
h1 {color:green;}
</style>
<h1>Nick Pettit</h1>
</body>
jason chan
31,009 Points<head>
<style>
.class {color:red;}
#id {color:green;}
p{color:tomato;}
</style>
</head>
<body>
<h1 class="class">This is a class</h1>
<p id="id">this is an id</p>
<p>I am a lonely selector</p>
</body>
I hope that helps.
Kern Tallett
10,012 PointsKern Tallett
10,012 PointsYou don't need the . before h1.