<?xml version="1.0" encoding="utf-8"?>

CSS background-repeat property

CSS background-repeat property Bad Practice
CSS background-repeat property Best Practice

By default, the browser repeats the background image, filling up the full element's box. But how can you control this repetition?

The background-repeat property allows you to:

  • Set a background image to repeat vertically along the y-axis, using the value repeat-y
  • Set the background image to repeat horizontally along the x-axis, using the value repeat-x
  • Set the background image to repeat in both directions, using the value repeat

If you don't want any repetition, set the value to no-repeat.

Improve your UX & Product skills with interactive courses that actually work