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

What does background repeat mean?

in css

background-repeat: no-repeat;

Nick says that background images will always repeat themselves. What does this mean? How does it repeat itself and why?

2 Answers

if a background image was lets say 250 by 250, and the canvas was 500 by 500 the background image would repeat itself to fit the size of the canvas so in the instance above it would be repeated 4 times

if you like you could set the background to not repeat, ie;

background-repeat:no-repeat;

or simply have it repeating on a certain axis, background-repeat:repeat-x;

It's basically another way of saying the background image will tile if it is not set to no-repeat (or something like cover).

Oh okay. So it will multiply itself and there will be many of the same image right?