font-weight - HTML CSS CSS Animatable Property

HTML CSS examples for CSS Animatable Property:font-weight

Introduction

In the following code the font-weight property of the following paragraph is animating from its initial value "normal" to "bold", and back to the initial value "normal" 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-weight Property Animation</title>
  <style type="text/css">
.animated {<!--from  w w w .  ja  v a2 s  .  c o m-->
  font-size: 32px;
    -webkit-animation: test 4s infinite; 
    animation: test 4s infinite;
}

@-webkit-keyframes test {
    50% {font-weight: bold;}
}

@keyframes test {
    50% {font-weight: bold;}
}
</style>
 </head>
 <body>

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

Related Tutorials