I would like to have a div with some text in it. But I would like the text to go vertically, not horizontally. Like this:
M
at
t
e
x
Any ideas on how to do this with CSS?
If you have only one line of text, you can try using width:1em;letter-spacing:1px (and a space between each letter)
width:1em;letter-spacing:1px
edit: if you do not want to use the space between letters width:1em;letter-spacing:1em;word-wrap:break-word
width:1em;letter-spacing:1em;word-wrap:break-word
CSS3 has the proposed attribute "write-mode", which can be set to "tb-lr" (write text from top to bottom, write lines from left to right), but I donโt know if browsers support it, but nevertheless itโs not that you can rely on.
.yourtext { -moz-transform: rotate(-90deg); -webkit-transform: rotate(-90deg); -moz-transform-origin: top right; -webkit-transform-origin: top right; filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); }
Please find the answer here, you can use text orientation and
Please check https://jsfiddle.net/yu7qr809/
div{ text-orientation: upright; writing-mode: vertical-lr; }
Source: https://habr.com/ru/post/916757/More articles:Javascript, CSS: get element attribute by style - javascriptHow to make ST computation produce a lazy result stream (or work as a joint procedure)? - pythonOpenCV RotatedRect with a given angle - opencvCheck if a point is inside the cone in three-dimensional space - javaVertical text orientation in css - cssSelecting text with multiple EditText controls at the same time - javaTypedef structure pointer definition - cIs OCaml function over polymorphic variants not polymorphic enough? - polymorphismHow to parse json object using jquery - jsonHow to integrate Java FX and Spring MVC - javaAll Articles