Home > Article > Web Front-end > Can CSS Display Text Vertically to the Right?
Is CSS Capable of Displaying Text Vertically to the Right?
Achieving vertically oriented text to the right using CSS is indeed possible. To accomplish this, you can manipulate the text's orientation and writing mode. However, it's important to note that not all browsers support the sideways text orientation property.
The following CSS code will orient the text vertically to the right, though it relies on a vendor-prefixed property:
div { writing-mode: vertical-rl; text-orientation: sideways; }
However, since sideways text orientation isn't supported universally, you can use a scale transformation as an alternative:
div { writing-mode: vertical-rl; transform: scale(-1); }
This alternative method achieves the same result, enabling you to have vertically oriented text to the right in a browser-compatible way.
The above is the detailed content of Can CSS Display Text Vertically to the Right?. For more information, please follow other related articles on the PHP Chinese website!