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
Jason Hsiao
Courses Plus Student 1,385 PointsCSS Select
Need some help for CSS Select, not sure how to do this question
Add an adjacent selector to make the text of a paragraph underlined if it follows an h2.
4 Answers
James Barnett
39,199 PointsWhat code do you have so far?
Seif Eldein Sayed
3,508 PointsDo you want all the paragraphs that follow an h2 to be underlined? or just one paragraph?
Gonzalo Garay
4,683 Pointsthe answer would be :
h2 p { your style }
or, i f you're doing the old css course: h2 + p { your style }
Cheers.
James Barnett
39,199 PointsGonzalo - Those 2 selectors, mean similar but different things the first uses a descendant selector and the 2nd uses an adjacent selector.
It's important to understand the differences between the 2, these 2 tutorials should help:
- http://css.maxdesign.com.au/selectutorial/selectors_adjacent.htm
- http://css.maxdesign.com.au/selectutorial/document_descendant.htm
The instructions that Jason referenced called for using an adjacent selector.