CSS Transparency animation effect
CSS Transparency animation
Make a HTML element transparent by changing the CSS propery opacity or alternatively use filter#opacity . You can customize the code by changing the
<style>
.transparency {
/* Uncomment as needed. */
/* width: 100px; */
/* height: 100px; */
/* background-color: deeppink; */
animation-name: transparency;
animation-duration: 7s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
@keyframes transparency {
0% { opacity: 1; }
50% { opacity: 0;}
/* Alternative */
/*
0% {filter: opacity(1); }
50% {filter: opacity(0); }
*/
}
</style>
- If you cannot see your HTML element when using our code, you may need to set a width and or height, or background on your target HTML element using CSS. Just uncomment the CSS properties in our code as needed.
- Remove the HTML style tag as needed.
- Change values in the code such as animation-duration as needed.
Animation effects source code licenced under
MIT Licence