adding an image using css code example
Example 1: how to add an image in css
.element {
background-image: url("imageFile.png");
}
Example 2: insert image by css
div.mydiv:after {
content: url(image.jpg);
}
or
div.mydiv {
width:100px;
height:100px;
background-image:url('image.file');
}
Example 3: adding animation to images css
basic animation drop
@keyframes drop {
0% {
opacity: 0;
transform: translateY(-80px);
}
100% {
opacity: 1;
transform: translateY(0px);
}
}
img {
animation: drop 500ms ease;
}