-2

I intend to make vertical words using CSS here is a demo:
enter image description here

How can I achieve it?

Maik Lowrey
  • 15,957
  • 6
  • 40
  • 79
Naziya
  • 39
  • 1
  • 6

4 Answers4

3

p {
  writing-mode: vertical-rl;
  text-orientation: mixed;
 }
<p>I am some cool text</p>

writing-mode: vertical-rl; text-orientation: mixed;

Reference

MomasVII
  • 4,641
  • 5
  • 35
  • 52
0

You can achieve it with text-orientation:

.txt { 
  writing-mode: vertical-rl;
  text-orientation: mixed;
}
<div class="txt">some text</div>

Source: https://developer.mozilla.org/en-US/docs/Web/CSS/text-orientation

Maik Lowrey
  • 15,957
  • 6
  • 40
  • 79
0

just use transform and rotate

.wrapper {
  margin: 100px 80px;
  transform: rotate(90deg);
  transform-origin: top center;
}

.number {
  display: inline-block;
  transform: rotate(-90deg);
}
<div class="wrapper">
  <div class="item">
    <span class="number">1</span>
    <span class="description">this is one</span>
  </div>
  <div class="item">
    <span class="number">2</span>
    <span class="description">this is two</span>
  </div>
  <div class="item">
    <span class="number">3</span>
    <span class="description">this is three</span>
  </div>
</div>
Frank
  • 21
  • 2
-1

You need transform: rotate property. Here you can find more info: [enter link description here][1]

https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/rotate()

krybinski
  • 79
  • 3