Answers for "add images in css"

CSS
4

how to insert image in css

<img src="fire-salamander.jpg">
/*Make sure that your file name is case accurate, put it where fire salamander is./*/
Posted by: Guest on September-20-2021
0

insert image by css

div.mydiv:after {
  content: url(image.jpg); /*url of your image*/
}

or

div.mydiv {
   width:100px; /*width of your image*/
   height:100px; /*height of your image*/
   background-image:url('image.file');
}
Posted by: Guest on September-11-2020
0

adding animation to images css

basic animation drop

//drop is variable named for the animation

@keyframes drop {
	0% {
		opacity: 0;
		transform: translateY(-80px);
	}
	100% {
		opacity: 1;
		transform: translateY(0px);
	}
}

img {
animation: drop 500ms ease;
}
Posted by: Guest on October-18-2020

Browse Popular Code Answers by Language