Answers for "how to add image to background in css"

CSS
124

css background image

background-image: url("image.png");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
Posted by: Guest on April-07-2020
21

background image

div {
  background-color: #ffffff;
  background-image: url("img_tree.png");
  background-repeat: no-repeat;
  background-attachment: scroll|fixed|local|initial|inherit;
  background-position: right top  |  x% y%  |  xpos ypos;
  background-clip: border-box|padding-box|content-box|initial|inherit;
  background-size: auto|length|cover|contain|initial|inherit;
}
//shorthand:
div {
  background: #ffffff url("img_tree.png") no-repeat right top;
}
Posted by: Guest on September-07-2020
5

add background image in css

.w {
background-image: url("images/tom1.png");
}

.a {
background-image: url("images/tom2.png");
}

.s {
background-image: url("images/tom3.png");
}
Posted by: Guest on August-20-2020

Code answers related to "how to add image to background in css"

Browse Popular Code Answers by Language