Favorites

CSS background-repeat-x Property

background-repeat-x
CSS PropertyThis property is supported in some modern browsers, but not all.
Updated 22nd November 2026

The background-repeat-x property sets how background images repeat horizontally. It is non-standard: use background-repeat.

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.

Description

The background-repeat-x property sets how background images are repeated along the horizontal axis only, leaving the y axis unchanged. It is a longhand of background-repeat defined in CSS Backgrounds Level 4, so that one axis can be changed without restating the other, for example in a media query.

It accepts the single-axis values of background-repeat: repeat, no-repeat, space and round, with a comma-separated list for multiple background layers. Browser support is incomplete: Firefox does not support it, and Safari supports it only partially, so in production set both axes with the background-repeat shorthand instead (for example background-repeat: repeat no-repeat).

Definition

Initial value
repeat
Applies to
all elements
Inherited
no
Computed value
as specified
Animatable
discrete
JavaScript syntax
object.style.backgroundRepeatX

Syntax

background-repeat-x: [ repeat | no-repeat | space | round ]#;

Values

  • repeatThe default. The image is repeated as often as needed along this axis; the last image may be clipped.
  • no-repeatThe image is not repeated along this axis.
  • spaceThe image is repeated as often as it fits without clipping; extra space is distributed between the images.
  • roundThe image is repeated as often as it fits and scaled so that a whole number of images fills the area.
  • initialSets the property to its initial value.
  • inheritTakes the computed value of the parent element.

Example

<div class="box"></div>
.box {
  width: 300px;
  height: 160px;
  border: 1px solid #ccc;
  background-image: radial-gradient(circle, #4361ee 40%, transparent 42%);
  background-size: 40px 40px;
  background-repeat-y: no-repeat;   /* repeat along one axis only */
}
Open in editor

Browser Support

The following information will show you the current browser support for the CSS background-repeat-x property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported in some modern browsers, but not all.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported

Looks like you're using an ad blocker, and that's fine! Ads help keep CSS Portal's generators and references free, so if the site's useful to you, visit our Support page to see other ways to help.