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.

HTML
<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

ClassCSS declarations
bg-repeatbackground-repeat: repeat;
bg-no-repeatbackground-repeat: no-repeat;
bg-repeat-xbackground-repeat: repeat-x;
bg-repeat-ybackground-repeat: repeat-y;
bg-repeat-roundbackground-repeat: round;
bg-repeat-spacebackground-repeat: space;
View full generated CSS
Compiled 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;
}