top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Which property is used to control the repetition of an image in the background in CSS?

0 votes
583 views
Which property is used to control the repetition of an image in the background in CSS?
posted Jun 27, 2017 by Naveen Kumar

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

background-repeat

The background-repeat CSS property defines how background images are repeated. A background image can be repeated along the horizontal axis, the vertical axis, both axes, or not repeated at all.

Syntax

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

Values

repeat
The background image will be repeated both vertically and horizontally. This is default.
repeat-x
The background image will be repeated only horizontally.
repeat-y
The background image will be repeated only vertically.
no-repeat
The background-image will not be repeated.

Example

/* One-value syntax */
background-repeat: repeat-x;
background-repeat: repeat-y;
background-repeat: repeat;
background-repeat: space;
background-repeat: round;
background-repeat: no-repeat;

/* Two-value syntax: horizontal | vertical */
background-repeat: repeat space;
background-repeat: repeat repeat;
background-repeat: round space;
background-repeat: no-repeat round;

background-repeat: inherit;
background-repeat: initial;
answer Jun 28, 2017 by Shyam Chakraborty
...