Is it possible to display text at an angle in a web page?

Ryan S picture Ryan S · Mar 23, 2011 · Viewed 14.3k times · Source

I would like to know whether it is possible or not to create text in a web page at an angle, for example at 40 Degrees. If it is possible, how can I do this?

EDIT: Finally, I decided to go with Mathias Bynens's answer.

Answer

Mathias Bynens picture Mathias Bynens · Mar 23, 2011

Use CSS3 transforms:

.selector {
  -webkit-transform: rotate(40deg);
  -moz-transform: rotate(40deg);
  -o-transform: rotate(40deg);
  transform: rotate(40deg);
}

IE does support filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);, where the rotation property accepts one of four values: 0, 1, 2, or 3 which will rotate the element 0, 90, 180 or 270 degrees respectively. It’s a filter though, so I wouldn’t recommended using it.