CSS Background Image

CSS background-image is a property used to set an image as the background of an HTML element.

Example
Try yourself
        
            body {
    background-image: url('/images/common/docker.png');
}

        
    
Remember

By default, the background image is repeated both horizontally and vertically to cover the entire background area of the element. If the image is smaller than the element, it will be tiled (repeated) to fill the space.


You can also control other aspects of the background image, such as its repetition behavior, position, and size, by using additional CSS properties like background-repeat, background-position, and background-size .


For example, to prevent the image from repeating and center it horizontally and vertically within the background area, you can use the following:

Try yourself
        
            body {
    background-image: url('/images/common/docker.png');
    background-repeat: no-repeat;
    background-position: center center;
}