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 trialAngela Williams
5,805 PointsWhat is the correct code for task 1 Challenge Pixels and Percentage? My answer : span .title { font-size: 26px: }
My answer is span .title {font-size: 26px;}
2 Answers
Tony Nguyen
24,934 PointsIn the html, you are trying to select
<span class="title"></span>
You should be selecting a span with the class title, so no space is needed.
span.title {
font-size: 26px;
}
Angela Williams
5,805 PointsThanks a lot Tony and Austin
Austin Whipple
29,725 PointsAustin Whipple
29,725 PointsAnd to expand on this, without a space (as in Tony's example), you'll select any <span> element with the class of "title" assigned. In your original code with a space in between, you're selecting any element with the class of "title" that is a descendant of a span. For instance, your original selector would style this:
Check out more combinators at W3Schools.