Home > Software engineering >  How to Change the background image size in custom css?
How to Change the background image size in custom css?

Time:05-07

i was trying like that,that is not working

.login{

margin-top: 70px;
margin-bottom: 100px;
background-image: url(../../Images/bg5.png);
background-size:0 500px;
width: 100%;

}

CodePudding user response:

I see the error. You have to add width value to background-size since your using two-value syntax (first value: width of the image, second value: height)

e.g. background-size:300px 500px;

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

Also remove width property.

  •  Tags:  
  • css
  • Related