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 trialKatie Beaton
Courses Plus Student 1,190 Pointshow do you set color for paragraphs with CSS?
I have tried adding #para but not sure this is write...
a {
text-decoration: none;
}
#wrapper {
max-width: 940px;
margin: 0 auto;
}
#logo {
text-align: center;
margin: 0;
}
h1, h2{
color: #fff;
}
#para {
color: #000;
}
5 Answers
Emma Davis
4,760 PointsIf you want a color applied to all paragraphs, you just use the paragraph tag 'p'. What you are trying to do is apply a colour to the any element with the id of 'para'.
So your css should be
p {
color: #000;
}
Martijn Schuijers
9,961 PointsYou should use the p element selector:
p {
color: #000;
}
Katie Beaton
Courses Plus Student 1,190 Pointsthank you both, going to need to make more notes I think... :)
Ethan Moffat
3,223 PointsAs the others have said you can just select all paragraph elements however, if you just want to select a certain paragraph here is the steps. First you were setting that #para to the color black which is default styling unless you changed the background color or have a image.
- Make sure you have the <p id="example">BlahBlahBlah</p>
- Go to your css stylesheet and select example #example { color: #fff; }
- Make sure all your pages are saved. CSS usually will not proceed to apply the styles if your home page is not saved. I hope that gives you a good example on what you were trying to do.
Katie Beaton
Courses Plus Student 1,190 Pointsthank you, have saved that note for future
Katie Beaton
Courses Plus Student 1,190 Pointsfeel bad having to choose a best answer as all helpful...