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

background-repeat

What does Nick mean by saying that backgrounds repeat by default in CSS?

2 Answers

When the dimensions the image set to the background is smaller than the area it is being asked to cover, it will by default, repeat to fill the space.

Check out MDNs documentation about display: https://developer.mozilla.org/en-US/docs/Web/CSS/display

Tnx :). It really helps.

Tnx :). It really helps.

My pleasure. Please mark as best answer. It helps me try to get a job!

He means that the image will repeat itself like like tiles in a wall.

.default-equal-to {
// browsers will apply it, no need to declare yourself 
   background-repeat: repeat;
}

.prevent-default-equal-to {
// now your img will show only once
   background-repeat: no-repeat;
// now your img will repeat only horizontally
  background-repeat: repeat-x;
// now your img will repeat only vertically
  background-repeat: repeat-y;
}

Tnx ;)