Home > Web Front-end > CSS Tutorial > How to Rotate Text Vertically Using CSS Across Different Browsers?

How to Rotate Text Vertically Using CSS Across Different Browsers?

Patricia Arquette
Release: 2024-12-18 09:55:10
Original
909 people have browsed it

How to Rotate Text Vertically Using CSS Across Different Browsers?

Rotating Text Vertically with CSS

Achieving cross-browser vertical text rotation requires browser-specific solutions. For browsers supporting CSS3 transforms, rotate() can be used.

CSS3 Transform:

.rotate {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}
Copy after login

This code rotates the text by 90 degrees counterclockwise and anchors the rotation to the center of the text.

Filter for IE:

For IE versions 5.5 and later, the filter property can be used:

.rotate {
  filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
Copy after login

The rotation=3 value rotates the text by 270 degrees counterclockwise.

moz-transform for Firefox:

For Firefox 3.5 and later, -moz-transform is used:

.rot-neg-90 {
  -moz-transform: rotate(270deg);
  -moz-transform-origin: 50% 50%;
}
Copy after login

-webkit-transform for Safari/Webkit:

For Safari and Webkit browsers, -webkit-transform is used:

.rot-neg-90 {
  -webkit-transform: rotate(270deg);
  -webkit-transform-origin: 50% 50%;
}
Copy after login

Browser Support:

These solutions provide cross-browser support for vertical text rotation in IE6 , Firefox 2 , Chrome, Safari, and Opera.

The above is the detailed content of How to Rotate Text Vertically Using CSS Across Different Browsers?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template