I want to type text from up to down, right to left like the image below. I just search around but didn't find any result that matches my requirement. How can I do that with HTML, CSS, javascript? Thanks!
Asked
Active
Viewed 113 times
2
-
1Possible duplicate of [Vertical Text Direction](https://stackoverflow.com/questions/4264527/vertical-text-direction) – str Jul 26 '18 at 08:12
-
@str no, my question is different. I don't want to show text in p, div or something else. I want to type text in textarea vertically. – Meo Beo Jul 26 '18 at 08:16
-
1have a look at the answer. You can use your div as an editable field. – Ullas Hunka Jul 26 '18 at 08:18
1 Answers
4
Use text-orientation
for the above quest the example is as follows:
.some {
writing-mode: vertical-rl;
text-orientation: upright;
border: 1px solid #000;
padding: 5px;
min-height: 50px;
min-width: 50px;
}
<div class='some' contenteditable=true>
some text <br>asdasdasdas<br> asdasdasdas<br> asdasdas<br> adasda<br> asdasd<br> adasda<br> adada
</div>
More details on the same can be found here

Ullas Hunka
- 2,119
- 1
- 15
- 28
-
-
@UllasHunka thank you, it's what I want. I haven't known that div has contenteditable attribute. – Meo Beo Jul 26 '18 at 08:23
-
@MeoBeo Pleasure is all mine. Just FYI The contenteditable attribute specifies whether the content of an element is editable or not. – Ullas Hunka Jul 26 '18 at 08:26