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 trialAlex Wylie
4,364 PointsPseudo-Elements - ::before and ::after Why do the icons stay as links?
Just curious, when i did the exercise for this video i noticed that the icons stay as links.
I was expecting that these elements would be placed before the "a" tag, and therefore they wouldn't be within the link?
2 Answers
Steven Parker
231,269 PointsThe pseudo elements are inside the element they are applied to.
The created pseudo elements become the first ("before") or last ("after") child of the element they are applied to, so in the case of an anchor element, they would also be part of the link.
Alex Wylie
4,364 Pointsthank you! This makes sense now