The mask-repeat property controls how a mask-image tiles across an element — using the same keywords as background-repeat.
01
Tiling
Tile the mask image.
02
repeat
Default both axes.
03
no-repeat
Single mask shape.
04
repeat-x / y
One-axis tiling.
05
WebKit
Prefix for Safari.
06
Related
mask-size, position.
Fundamentals
Introduction
The mask-repeat property in CSS defines how a mask image is repeated (tiled) across an element. This property lets you control the repetition behavior of the mask image, which can enhance the visual presentation of your web elements.
Masking is commonly used to create complex shapes, gradients, and patterns by overlaying an image that determines the visibility of different parts of the element. Pair it with mask-image, mask-size, and mask-position for full control.
Definition and Usage
Use mask-repeat: repeat (the default) to tile a small mask into a pattern, no-repeat for a single silhouette, or repeat-x / repeat-y to tile along one axis only. The syntax mirrors background-repeat, so if you know one, the other feels familiar.
💡
Beginner Tip
Set a small mask-size (like 48px) first — then change only mask-repeat to clearly see how tiling differs from a single mask shape.
Foundation
📝 Syntax
The syntax for the mask-repeat property can accept one or two values, representing the horizontal and vertical repeat behavior:
Pick repeat, no-repeat, repeat-x, or repeat-y to control tiling.
Repeat values
3
Browser tiles the mask
The mask image repeats according to your value, sized by mask-size and positioned with mask-position.
Tiling logic
=
🖼
Pattern or single mask
The element shows a repeating pattern or a single masked shape, depending on the repeat value you chose.
Compatibility
🖥 Browser Compatibility
The mask-repeat property is supported in most modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. Include -webkit-mask-repeat for Safari, and test across browsers to ensure your mask tiling looks correct.
✓ Baseline · Modern browsers
Mask repeat in modern browsers
All standard repeat keywords work in major browsers. Use the WebKit prefix for best Safari coverage.
95%Modern browser support
Google Chrome55+ · Desktop & Mobile
Full support
Mozilla Firefox54+ · Desktop & Mobile
Full support
Apple Safari9.1+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera42+ · Modern versions
Full support
mask-repeat property95% supported
Bottom line: Safe for modern projects. Pair mask-repeat with -webkit-mask-repeat and test PNG masks in Safari.
Wrap Up
🎉 Conclusion
The mask-repeat property is a versatile tool for web designers looking to create visually compelling effects using mask images.
By controlling how the mask image tiles, you can add depth and style to your web elements. Experiment with repeat, no-repeat, and axis-specific values to achieve the effect you want.
Forget WebKit prefixes when targeting Safari users
Expect visible tiling when mask-size: cover fills the entire area
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about mask-repeat
Use these points when tiling a mask image on an element.
5
Core concepts
🖼01
repeat
Default tiling.
Default
⚙02
no-repeat
Single mask.
Common
↔03
repeat-x / y
One-axis tiles.
Patterns
img04
Like background-repeat
Same keywords.
Familiar
web05
WebKit prefix
Safari support.
Compat
❓ Frequently Asked Questions
The mask-repeat property defines how a mask image is repeated (tiled) across an element. It works like background-repeat but applies to the mask-image layer.
The default value is repeat, which tiles the mask image both horizontally and vertically across the element.
They accept the same keyword values, but mask-repeat controls tiling of the mask-image layer while background-repeat controls the background-image layer.
No. mask-repeat only affects how a mask tiles when a mask-image is set. You must define the mask source first.
Use no-repeat when you want a single mask shape — such as a logo silhouette or one decorative cutout — instead of a repeating pattern.