Home  >  Article  >  Web Front-end  >  Can CSS Display Text Vertically to the Right?

Can CSS Display Text Vertically to the Right?

Patricia Arquette
Patricia ArquetteOriginal
2024-11-10 14:14:02717browse

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!

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