font-size - HTML CSS CSS Animatable Property

HTML CSS examples for CSS Animatable Property:font-size

Introduction

In the following code the font-size property of the following paragraph is animating from its initial value "16px" to "42px", and back to the initial value "16px" 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 font-size Property Animation</title>
  <style type="text/css">
.animated {<!--   w  ww  .j a  va 2 s.  com-->
  font-size: 16px;
    -webkit-animation: test 4s infinite; 
    animation: test 4s infinite;
}

@-webkit-keyframes test {
    50% {font-size: 42px;}
}

@keyframes test {
    50% {font-size: 42px;}
}
</style>
 </head>
 <body>

  <p> </p>
  <p class="animated">This is an animated paragraph.</p>
 </body>
</html>

Related Tutorials