Browse documentation
Reference / Backgrounds
Background repeat
Repeat a background along one axis, in both directions, or as a single image.
Working example
Use repeat-x for a decorative rule. The chosen background size sets the distance between neighboring marks.
<div role="img" aria-label="A horizontal dotted rule"
class="h-16 border bg-[radial-gradient(circle,#222_2px,transparent_3px)] bg-[size:16px_16px] bg-center bg-repeat-x"></div>Class reference
| Class | CSS declarations |
|---|---|
bg-repeat | background-repeat: repeat; |
bg-no-repeat | background-repeat: no-repeat; |
bg-repeat-x | background-repeat: repeat-x; |
bg-repeat-y | background-repeat: repeat-y; |
bg-repeat-round | background-repeat: round; |
bg-repeat-space | background-repeat: space; |
View full generated CSS
.bg-no-repeat {
background-repeat: no-repeat;
}
.bg-repeat {
background-repeat: repeat;
}
.bg-repeat-round {
background-repeat: round;
}
.bg-repeat-space {
background-repeat: space;
}
.bg-repeat-x {
background-repeat: repeat-x;
}
.bg-repeat-y {
background-repeat: repeat-y;
}