0
I need to put one background image for all my site how can I do it
4 Answers
+ 3
To add more on positioning background image, please check out the following codes:
Only use background shorthand to achieve it.
The format is
background: url(image.jpg) <x> <y> / <size> no-repeat;
where x is x position in %/px or left, center, right
y is y position in %/px, or top, center, bottom
size is image size in % (% of the original image size).
https://code.sololearn.com/Wn4dsAwJ2M8f/?ref=app
https://code.sololearn.com/W5HkVaC5uFo3/?ref=app
https://code.sololearn.com/WIKpkId9F1s1/?ref=app
https://code.sololearn.com/W6C42qMCYR4U/?ref=app
https://code.sololearn.com/Wx6ljf1vrK7i/?ref=app
https://code.sololearn.com/WvvEA7znzQr5/?ref=app
https://code.sololearn.com/W0ufFxdLTP11/?ref=app
+ 1
body {
background-image: url("path");
}
+ 1
To add onto what Galstyan said, depending upon the image you're using, you may also want to use this to scale the image to fit the entire background:
background-size: cover;
or
background-size: 100%;
+ 1
or in short writing Jakko Jak
Body{
background: url("path") no-repeat center/cover;
}