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

CSS CSS Layout Basics Positioning Page Content Create an Image Caption with Absolute Positioning

ILYAS KERBAL
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
ILYAS KERBAL
Front End Web Development Techdegree Graduate 15,209 Points

A 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
Steven Parker
231,269 Points

Be 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.

Steven Parker
Steven Parker
231,269 Points

OK, 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?