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 How to Make a Website Adding Pages to a Website Add and Style Icons

how do i set a background image to 20px square?

I was tasked to set the background image of an anchor element to '20px square' could someone explain what that means? I presume the 20px means the dimensions of the background ( 20x20 ) but I don't understand the 'square' bit.

5 Answers

Robert Manolis
STAFF
Robert Manolis
Treehouse Guest Teacher

I think you got it. 20px square should mean a shape with 20 px on each side, four equal sides makes a square.

what you want to do is set the dimensions of the anchor element, width and height, and then apply a background image with your css since you can't really style background images directly.

hope that helps

Thanks man, managed to figure it out now. Silly mistake on my part. Many thanks.

Robert Manolis
STAFF
Robert Manolis
Treehouse Guest Teacher

Good. Love it when it all works out. I don't want to sound greedy, but how about a bump or best answer or something, if it's not too much trouble, and if you are okay with it.

happy coding :)

xD sure thing.