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

Sahar Nasiri
Sahar Nasiri
7,454 Points

background-repeat

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

2 Answers

Jonathan Walz
Jonathan Walz
21,429 Points

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

Sahar Nasiri
Sahar Nasiri
7,454 Points

Tnx :). It really helps.

Sahar Nasiri
Sahar Nasiri
7,454 Points

Tnx :). It really helps.

Jonathan Walz
Jonathan Walz
21,429 Points

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

FΓ‘bio Tavares da Costa
FΓ‘bio Tavares da Costa
11,985 Points

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;
}