Home > OS >  Background image doesn't appear while writing in css
Background image doesn't appear while writing in css

Time:03-31

StackOverflow. I got problem, when I'm trying to put background image it doesn't appear

Here's the code

body {
    background-image: url(https://i.pinimg.com/originals/90/db/f4/90dbf402730c059e0f106ce80d1d779a.jpg);
}

CodePudding user response:

Can you please add

body {
  background-image: url(https://i.pinimg.com/originals/90/db/f4/90dbf402730c059e0f106ce80d1d779a.jpg);
  background-position: 100% 100%;
  background-size: cover;
}

For background position

https://css-tricks.com/almanac/properties/b/background-position/

For background size

https://developer.mozilla.org/en-US/docs/Web/CSS/background-size

CodePudding user response:

I can display the image on the background with the following code (you can change the 100% to another value in order to rescale the image):

body {
    background: no-repeat center/100% url(https://i.pinimg.com/originals/90/db/f4/90dbf402730c059e0f106ce80d1d779a.jpg);
}
  • Related