Last updated: 15 January 2026

Tailwind CSS Background Repeat

Learn how Tailwind background repeat utilities work, bg-repeat, bg-no-repeat, bg-repeat-x and bg-repeat-y with responsive breakpoint examples included


Interactive Background Repeat Playground

Try each class live and inspect the CSS output.

Utility class
bg-repeat
CSS output
background-repeat: repeat;

The background repeat utility class in Tailwind CSS allows you to control the repetition behavior of background images applied to elements. With Tailwind background repeat class, you can easily adjust how background images are repeated to achieve the desired visual effect.

How to apply Tailwind Background Repeat

To apply a specific tailwind background repeat behavior to an element, you can use the bg-{repeat} utility class, where {repeat} represents the desired background repeat behavior. Here are some common values you can use:

  • bg-repeat: The background image is repeated both horizontally and vertically.
  • bg-no-repeat: The background image is not repeated, appearing only once.
  • bg-repeat-x: The background image is repeated horizontally but not vertically.
  • bg-repeat-y: The background image is repeated vertically but not horizontally.
HTML
1<div
2 class="w-full bg-repeat bg-[url('https://images.unsplash.com/photo-1623697899813-cf12fa9bc1c3?q=80&w=553&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D')]"
3></div>

Example bg-no-repeat

HTML
1<div class="p-4">
2 <div
3 class="bg-no-repeat w-full h-80 bg-center rounded-md bg-[url('https://images.unsplash.com/photo-1623697899813-cf12fa9bc1c3?q=80&w=553&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D')]"
4 ></div>
5</div>

Use bg-no-repeat when you want the image to appear only once, like a logo or icon

Example bg-repeat-x

HTML
1<div class="p-4">
2 <div
3 class="bg-repeat-x w-full h-80 bg-center rounded-md bg-[url('https://images.unsplash.com/photo-1623697899813-cf12fa9bc1c3?q=80&w=553&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D')]"
4 ></div>
5</div>

Example bg-repeat-y

HTML
1<div class="p-4">
2 <div
3 class="bg-repeat-y w-full h-300 bg-center rounded-md bg-[url('https://images.unsplash.com/photo-1623697899813-cf12fa9bc1c3?q=80&w=553&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D')]"
4 ></div>
5</div>

Responsive Tailwind Background Repeat

Tailwind CSS allows you to apply background repeat classes responsively at different breakpoints. To use responsive tailwind background repeat classes, you can append the breakpoint prefix to the utility class. For example, md:bg-no-repeat sets the background to not repeat starting from the medium breakpoint and above.

HTML
1<div class="p-4">
2 <div
3 class="bg-repeat md:bg-no-repeat w-full h-100 bg-center rounded-md bg-[url('https://images.unsplash.com/photo-1623697899813-cf12fa9bc1c3?q=80&w=553&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D')]"
4 ></div>
5</div>

In the above example, the tailwind background repeat behavior of the <div> element is set to not repeat by default (bg-no-repeat), but starting from the medium breakpoint and above, it changes to repeat both horizontally and vertically (md:bg-repeat).

Tailwind Background Repeat Class Table

ClassProperties
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;

✨ What's Next?

Now that you’ve mastered Tailwind Background Repeat, try experimenting with:

Windframe Tailwind blocks

Windframe is an AI visual editor for rapidly building stunning web UIs & websites

Start building stunning web UIs & websites!

Build from scratch or select prebuilt tailwind templates