css body sets background-image, the image should overflow vertically or horisontaly
- User
css body sets background-image, the image should overflow vertically or horisontaly
- Assistant
To make a background image overflow either vertically or horizontally when applied to the
<body>element using CSS, you need to set thebackground-sizeproperty appropriately. Thebackground-sizecan be set to auto, cover, or contain, among other values. Here’s how you can achieve the desired effect:-
Vertical Overflow (Horizontal Repeat):
If you want the image to overflow vertically (meaning it should repeat horizontally if needed), you can set the property so that the width of the image fits the body, allowing the height to extend beyond the viewport.
-