CSS background-repeat Property
Description
The background-repeat property in CSS is used to control how a background image is repeated within an element. By default, most background images repeat both horizontally and vertically to fill the entire area of the element. However, there are situations where repeating the image in one direction, or not at all, can dramatically change the visual appearance of a design. Understanding and manipulating the repetition behavior is crucial for creating patterns, textures, or custom designs that align precisely with the layout of a page.
In addition to controlling the repetition itself, background-repeat works closely with other background-related properties. For example, background-size allows you to resize a background image, which can affect how and when the image repeats. When combined, these properties give designers precise control over the placement, scale, and tiling of images. For instance, a small repeating image can create a seamless pattern, whereas a larger image might only appear once without repetition, creating a more dramatic visual effect.
Moreover, background-repeat is useful in responsive design contexts. By choosing whether an image should repeat horizontally, vertically, or not at all, designers can ensure that background visuals adapt gracefully to different screen sizes and orientations. For example, a horizontal stripe pattern might only repeat along the x-axis, maintaining its look across wide layouts, while vertical repetition could suit tall sidebars. Additionally, this property interacts with background-position, as the starting point of the image can influence how the repetition aligns with the rest of the content, allowing for more creative and intentional designs.
Definition
- Initial value
- repeat
- Applies to
- All elements
- Inherited
- No
- Computed value
- A list, each item consisting of: two keywords, one per dimension
- Animatable
- No
- JavaScript syntax
- object.style.backgroundRepeat
Interactive Demo
Syntax
background-repeat: <repeat-style> [ , <repeat-style> ]*
Values
- repeatThe image is repeated horizontally and vertically. In CSS3, if two keywords are used, the image is repeated along the relevant axis.
- repeat-xThe image is repeated along the horizontal axis.
- repeat-yThe image is repeated along the vertical axis.
- no-repeatThe image is not repeated.
- spaceThe image is repeated as often as will fit into the background area a whole number of times, and is spaced out so that the first and last ones touch the edges. (CSS3)
- roundThe image is repeated as often as will fit into the background area, and is rescaled if necessary to make it fit a whole number of times. (CSS3)
- inherit
Example
Browser Support
The following information will show you the current browser support for the CSS background-repeat property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
