Home >Web Front-end >CSS Tutorial >How to Achieve Cross-Browser Vertical Text with CSS?

How to Achieve Cross-Browser Vertical Text with CSS?

Susan Sarandon
Susan SarandonOriginal
2024-12-21 18:25:22529browse

How to Achieve Cross-Browser Vertical Text with CSS?

Cross-Browser Vertical Text using CSS

Query: How can text be rotated vertically to a 90-degree angle, ensuring compatibility across various browsers (IE6 , Firefox 2 , Chrome, Safari, Opera)?

Solution:

The latest advancements include CSS3's -webkit-transform, -moz-transform, and transform properties. Their syntax is:

transform: rotate(-90deg);
transform-origin: 50% 50%;

For older browsers, the legacy IE filter can be employed via:

filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);

Additionally, for Firefox 3.5 or later and WebKit/Safari 3.1 or later, the -moz-transform and -webkit-transform properties can be utilized:

-moz-transform: rotate(270deg); /* Use 270 degrees for negative angle */
-moz-transform-origin: 50% 50%;
-webkit-transform: rotate(270deg); /* Use 270 degrees for negative angle */
-webkit-transform-origin: 50% 50%;

The above is the detailed content of How to Achieve Cross-Browser Vertical Text with CSS?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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