Amethyst
6
Q:

css add image

.element {
  background-image: url("imageFile.png");
}
2
background-image: url("imageFile.png");
2
background-image: url('images/my-image.png');
0

    <img src="smiley.gif" alt="Smiley face" width="42" height="42" style="vertical-align:bottom">

    <img src="smiley.gif" alt="Smiley face" width="42" height="42" style="vertical-align:middle">

    <img src="smiley.gif" alt="Smiley face" width="42" height="42" style="vertical-align:top">

    <img src="smiley.gif" alt="Smiley face" width="42" height="42" style="float:right">

    <img src="smiley.gif" alt="Smiley face" width="42" height="42" style="float:left"> 
0
background-image: url(file name or url);
background-repeat: no-repeat;
background-position: center;
0
.parent {
  position: relative;
  top: 0;
  left: 0;
}
.image1 {
  position: relative;
  top: 0;
  left: 0;
  border: 1px red solid;
}
.image2 {
  position: absolute;
  top: 30px;
  left: 30px;
  border: 1px green solid;
}
0

New to Communities?

Join the community