background-repeat
The background-repeat property is used in CSS to control how a background image is repeated within an element's background area. It specifies whether the image should repeat horizontally, vertically, both, or not at all.
The possible values for background-repeat are:
-
repeat: This is the default value, and it allows the background image to repeat both horizontally and vertically to fill the entire background area.
-
repeat-x: This value allows the background image to repeat only horizontally, creating a tiled effect in the x-axis.
-
repeat-y: This value allows the background image to repeat only vertically, creating a tiled effect in the y-axis.
-
no-repeat: This value prevents the background image from repeating at all. It is displayed only once within the background area.
Example usage:
.element {
background-image: url('image.jpg');
background-repeat: repeat-x;
}
In this example, the background image 'image.jpg' will be repeated horizontally within the element's background area
原文地址: https://www.cveoy.top/t/topic/ibSU 著作权归作者所有。请勿转载和采集!