🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Expert Masterclasses.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEcss

css Documentation

LOADING ENGINE...

CSS background-repeat

Control how your background images tile. Learn repeat, no-repeat, space, and round.

style.css
/* No Tiling */
.box {
background-repeat: no-repeat;
}
/* Tiling Horizontal */
.strip {
background-repeat: repeat-x;
}
🔁
style.css
1 / 9
🎨

Tutor:Welcome. By default, background images in CSS repeat both vertically and horizontally to fill the container. This is called 'tiling'.


CSS Mastery

Unlock nodes by learning repetition logic.

Concept 1: Default Tiling

The default behavior of background-repeat is to tile the image in both directions. This ensures the background covers the entire element.

System Check

What is the default value of background-repeat?


Community Holo-Net

Share Pattern Tips

Created cool seamless patterns? Share your CSS settings.

Enjoying this guide?

Codesyllabus is 100% free and open-source. Support our mission, pay for server infrastructure, and fuel new tutorials by buying us a coffee!

CSS Background Repeat

Author

Pascual Vila

Frontend Instructor.

The background-repeat CSS property sets how background images are repeated. A background image can be repeated along the horizontal and vertical axes, or not repeated at all.

Default Behavior

By default, a background image repeats both vertically and horizontally. This creates a tiling effect. While useful for small patterns, it can be undesirable for logos or large hero images.

Controlling Repetition

You can control the repetition using the following values:

  • repeat: The image is repeated in both directions (default).
  • repeat-x: The image is repeated only horizontally.
  • repeat-y: The image is repeated only vertically.
  • no-repeat: The image is not repeated. It is shown only once.

Advanced Values: Space and Round

Space: The image is repeated as much as possible without clipping. The first and last images are pinned to either side of the element, and whitespace is distributed evenly between the images.

Round: The image is repeated as often as will fit within the available space. If it doesn't fit a whole number of times, the images are rescaled (stretched or squished) so they do.

Background Repeat Glossary

repeat (default)
Repeats the image in both vertical and horizontal directions to fill the container.
no-repeat
The background image is displayed only once. It does not tile.
repeat-x
Repeats the image only along the horizontal (x) axis.
space
Repeats images without clipping, distributing extra space evenly between them.
round
Repeats images and resizes them to fill the container exactly without gaps.