How to Achieve Vertical Right-Side Text Orientation in CSS?

Susan Sarandon
Release: 2024-11-11 16:39:02
Original
948 people have browsed it

How to Achieve Vertical Right-Side Text Orientation in CSS?

CSS Text Orientation: Achieving Vertical Right-Side Orientation

In CSS, text orientation can be manipulated using the writing-mode and text-orientation properties. To achieve vertically oriented text that faces right, like an image you may have seen, requires a combination of these properties. However, it's worth noting that text-orientation is not universally supported across browsers.

Original Attempted Code:

div {
  writing-mode: vertical-rl;
  text-orientation: sideways;
}
Copy after login

Solution with Transformation:

div {
  writing-mode: vertical-rl;
  transform: scale(-1);
}
Copy after login

The original code attempts to use sideways. However, for wider browser compatibility, you can substitute it with a scale transformation. By employing the transform: scale(-1) rule, the text will be flipped horizontally, reversing its orientation and effectively creating a right-side vertical text alignment.

HTML:

<div>dimanche</div>
Copy after login

The above is the detailed content of How to Achieve Vertical Right-Side Text Orientation in CSS?. 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