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 trial
isaiah miller
941 PointsCSS Code Challenge Question
Hello I'm stuck on this question
Add a type selector to make all of the paragraph tags the background color black and text white.
Please help.
* {
color: black;
background-color: white;
}
p { line-height: 1em; }
h1, h2, h3, h4 {
color: blue;
font-weight: normal;
line-height: 1.1em;
margin: 0 0 .5em 0;
}
3 Answers
Derrick Lee
7,743 PointsHello! If I interpreted your question properly, your question asks for a type selector to make only all paragraphs have a background color of black and a color of white.
Your problem is, instead of using the type selector to target paragraphs, you're using an universal selector.
By using an asterisk, you have targeted everything in your html document to have a background color of white and a color of black.
The solution to this problem, is to use the type selector, "p", without the quotes.
p { background-color: black; color: white; };
isaiah miller
941 Pointsthank you derrick that worked!!
Derrick Lee
7,743 PointsGlad i could help ;)