CSS Ascend animation effect

CSS Ascend animation

Simple pure CSS animation effect to let an HTML element ascend using the transform#translateY CSS property.

<style> .ascend { /* Uncomment as needed. */ /* width: 100px; */ /* height: 100px; */ /* background-color: deeppink; */ animation-name: ascend; animation-duration: 5s; animation-iteration-count: infinite; } @keyframes ascend { /* We first translate our HTML element in Y direction, to make it look like our element begins to rise from the floor. Change the values as needed. */ 0% { transform: translateY(40%); } 100% { transform: translateY(-50%); } } </style>
    Hints:
  • 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