vertical-align - HTML CSS CSS Animatable Property

HTML CSS examples for CSS Animatable Property:vertical-align

Introduction

In the following code the vertical alignment of the following marker images is animating from its initial value "bottom" to "top", and back to the initial value "bottom" again up to infinite times.

-webkit- prefix is for Chrome, Safari, Opera.

-moz- prefix is for Firefox.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html lang="en">
 <head>
  <title>Example of CSS vertical-align Property Animation</title>
  <style type="text/css">
.animated {<!--   w  w  w  .  j a v  a2 s  . c om-->
  vertical-align: bottom;
    -webkit-animation: test 4s infinite; 
    animation: test 4s infinite;
}

@-webkit-keyframes test {
    50% {vertical-align: top;}
}

@keyframes test {
    50% {vertical-align: top;}
}
</style>
 </head>
 <body>

  <p> </p>
  <h1>
    <img src="https://www.java2s.com/style/demo/Opera.png" alt="Marker Left" class="animated"> CSS vertical-align Animation 
    <img src="https://www.java2s.com/style/demo/Firefox.png" alt="Marker Right" class="animated"></h1>
 </body>
</html>

Related Tutorials