-webkit-mask-repeat-x CSS property

Non-standard: This feature is not standardized. We do not recommend using non-standard features in production, as they have limited browser support, and may change or be removed. However, they can be a suitable alternative in specific cases where no standard option exists.

The -webkit-mask-repeat-x property specifies whether and how a mask image is repeated (tiled) horizontally.

Syntax

css
/* Keyword values */
-webkit-mask-repeat-x: repeat;
-webkit-mask-repeat-x: no-repeat;
-webkit-mask-repeat-x: space;
-webkit-mask-repeat-x: round;

/* Multiple values */
-webkit-mask-repeat-x: repeat, no-repeat, space;

/* Global values */
-webkit-mask-repeat-x: inherit;
-webkit-mask-repeat-x: initial;
-webkit-mask-repeat-x: revert;
-webkit-mask-repeat-x: revert-layer;
-webkit-mask-repeat-x: unset;

Values

repeat

The mask image is repeated both horizontally and vertically.

no-repeat

The mask image is not repeated; only one copy of the mask image is drawn. The remainder of the masked element's content is not displayed.

repeat

The mask image is repeated both horizontally and vertically.

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. The mask-position property is ignored unless only one image can be displayed without clipping. The only case where clipping happens using space is when there isn't enough room to display one image.

round

As the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added. When the next image is added, all of the current ones compress to allow room. Example: An image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added. They will then compress to 225px.

Formal definition

Initial valuerepeat
Applies toall elements
Inheritedno
Computed valueas specified
Animation typediscrete

Formal syntax

-webkit-mask-repeat-x = 
[ repeat | no-repeat | space | round ]#

Examples

Using a repeating or non-repeating mask image

css
.example-one {
  -webkit-mask-image: url("mask.png");
  -webkit-mask-repeat-x: repeat;
}

.example-two {
  -webkit-mask-image: url("mask.png");
  -webkit-mask-repeat-x: no-repeat;
}

Using multiple mask images

You can specify a different <repeat-style> for each mask image, separated by commas:

css
.example-three {
  -webkit-mask-image: url("mask1.png"), url("mask2.png");
  -webkit-mask-repeat-x: repeat, space;
}

Each image is matched with the corresponding repeat style, from first specified to last.

Specifications

Not part of any standard.

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
-webkit-mask-repeat-x
Non-standard
Chrome – No support
Chrome 3 – 119 (Release date: 2009-09-15)
footnote Removed in 120 and later
Edge – No support
Edge 79 – 119 (Release date: 2020-01-15)
footnote Removed in 120 and later
Firefox – No support
Firefox
footnote No support
Opera – No support
Opera 15 – 105 (Release date: 2013-07-02)
footnote Removed in 106 and later
Safari – No support
Safari 5 – 14.1 (Release date: 2010-06-07)
footnote Removed in 15 and later
Chrome Android – No support
Chrome Android 18 – 119 (Release date: 2012-06-27)
footnote Removed in 120 and later
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android 14 – 79 (Release date: 2013-05-21)
footnote Removed in 80 and later
Safari on iOS – No support
Safari on iOS 5 – 14.5 (Release date: 2011-10-12)
footnote Removed in 15 and later
Samsung Internet – No support
Samsung Internet 1 – 24 (Release date: 2013-04-27)
footnote Removed in 25 and later
WebView Android – No support
WebView Android 4.4 – 119 (Release date: 2013-12-09)
footnote Removed in 120 and later
WebView on iOS – No support
WebView on iOS 5 – 14.5 (Release date: 2011-10-12)
footnote Removed in 15 and later

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Non-standard. Check cross-browser support before using.

See also

-webkit-mask-repeat, -webkit-mask-repeat-y