CSS background-repeat Property


The background-repeat property sets if/how a background image will be repeated.

The background-repeat property in CSS is used to repeat the background image both horizontally and vertically. It also decides whether the background-image will be repeated or not.

Syntax

background-repeat: repeat|repeat-x|repeat-y|no-repeat|initial|
inherit;

Property Values

repeat: This property is used to repeat the background image both horizontally and vertically. The last image will be clipped if it is not fit in the browser window.

Tip: The background image is placed according to the background-position property. If no background-position is specified, the image is always placed at the element's top left corner.

Example -