Animation How to - Scale text








Question

We would like to know how to scale text.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.pane {<!--from   w w w.  j  a  va2s .  co m-->
  margin: 0 auto;
  width: 265px;
  padding: 10px;
  top: 28px;
  position: absolute;
  background: red;
  left: 17px;
  overflow: hidden;
  -webkit-border-radius: 7px;
  -webkit-box-shadow: rgba(0, 0, 0, 0.25) 0 1px 4px, rgba(0, 0, 0, 0.04) 0 -1px 0;
  font-size: 22px;
  font-weight: normal;
  -webkit-transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
}

#promo {
  margin: -10px;
  width: 285px;
  height: 160px;
  overflow: hidden;
  -webkit-border-radius: 7px;
}

#promo span {
  -webkit-animation-name: closerlook;
  -webkit-animation-timing-function: ease-out;
  -webkit-animation-iteration-count: 2;
  -webkit-animation-duration: 5s;
  -webkit-animation-direction: alternate;
}

.image {
  background: tranparent;
  -webkit-border-radius: 7px;
  height: 100%;
  width: 100%;
  display: block;
  overflow: hidden;
}

@-webkit-keyframes closerlook {
   from { -webkit-transform:scale(1);}
   to {  -webkit-transform: scale(1.15) translate3d(-3%, -3%, 0);}
}
</style>
</head>
<body>
  <div class="pane">
    <div id="promo">
      <span class="image">this is a text.</span>
    </div>
  </div>
</body>
</html>

The code above is rendered as follows: