CSS: How to Set a Background Image for the Body
To set a background image for the body using CSS, you can use the following code:
body {
background-image: url('path_to_your_image.jpg');
background-repeat: no-repeat;
background-size: cover;
}
Replace 'path_to_your_image.jpg' with the actual path to your image file. The background-repeat property is set to no-repeat to prevent the image from repeating. The background-size property is set to cover to ensure the image covers the entire body element.
原文地址: https://www.cveoy.top/t/topic/o7aG 著作权归作者所有。请勿转载和采集!