jQuery Page Widget How to - Rotate text








Question

We would like to know how to rotate text.

Answer


<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
</head><!--from   w ww  .j a  v a  2  s .  c  om-->
<body>
  <div class="active">Rotate at angle of 20 deg</div>
  <script>
$('.active').css({ 
  'transform': 'rotate(-20deg)', 
  '-webkit-transform': 'rotate(-20deg)', 
  '-moz-transform': 'rotate(-20deg)',
  'margin-top':'5em'
});
</script>
</body>
</html>

The code above is rendered as follows: