Home > OS >  How to avoid number of repeating background images in CSS?
How to avoid number of repeating background images in CSS?

Time:12-17

I had tried to set the background image. But when I set then it show multiples number of images repeating in a background.

.myClassName {
  background: url("image.png");
  height:500px;
  width:1000px;
}

CodePudding user response:

/*You can use it on the same line*/
.myClassName {
  background: url("image.png") no-repeat; /* here */
  height:500px;
  width:1000px;
}

You can learn more about css background here: developer.mozilla.org

CodePudding user response:

Try this to .myClassName:

background-repeat: no-repeat;
  • Related