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

HTML How to Make a Website Adding Pages to a Website Add Iconography

Sebastian Hewelt
seal-mask
.a{fill-rule:evenodd;}techdegree
Sebastian Hewelt
Front End Web Development Techdegree Student 1,254 Points

Why do we set background properties here?

Hey,

I have a problem, it wasn't explicitly explained. Why do we set "background-repeat" and "background-size" here?

I know the general rule that in default background repaeats etc., but what does it have to do with anchor element? How could an anchor element's background repeat, if it's just an anchor, and there's no background, just one icon.

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

It's because that image is not being loaded into an image element, it's being loaded in as a background to to a link. And since everything is mostly done with percentages and relative measurements these days there's still the off chance that the containing element will grow to be larger than the picture loaded into the background. If that happens, and we don't say otherwise, that image will start repeating. Hope this helps! :smiley: