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 trialILYAS KERBAL
Front End Web Development Techdegree Graduate 15,209 PointsA better solution for adding the location icon
Instead of putting two images inside the figure tag:
figure::after {
content: url(../img/location.svg);
position: absolute;
right: -1em;
top: -1em;
width: 2em;
height: 2em;
}
2 Answers
Steven Parker
231,275 PointsBe aware that doing this will add a location icon to every figure element on the page. That's great if it's what you really want but I don't think that was the intention in this video.
ILYAS KERBAL
Front End Web Development Techdegree Graduate 15,209 PointsYes, you can specify the figure you want by using a class or ID. My point is not using two images inside a single figure tag
.
Steven Parker
231,275 PointsOK, but I'm still a little confused about what makes this approach "better". So overlooking the selector issue, could you explain why having two images in a figure is a disadvantage, and/or how having one added as a pseudo-element instead of in the HTML is an advantage?