1/* Answer to: "css rotate text" */
2
3/*
4 If what you are looking for is a way to set type vertically,
5 you’re best bet is probably CSS writing-mode, here's a link:
6 https://css-tricks.com/almanac/properties/w/writing-mode/
7
8 If you’re just trying to turn some text, you can rotate entire
9 elements like this, which rotates it 90 degrees counterclockwise:
10*/
11
12.rotate {
13 transform: rotate(-90deg);
14
15 /* Legacy vendor prefixes that you probably don't need... */
16 /* Safari */
17 -webkit-transform: rotate(-90deg);
18 /* Firefox */
19 -moz-transform: rotate(-90deg);
20 /* IE */
21 -ms-transform: rotate(-90deg);
22 /* Opera */
23 -o-transform: rotate(-90deg);
24 /* Internet Explorer */
25 filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
26}
27
28/*
29 For more information go to:
30 https://css-tricks.com/snippets/css/text-rotation/
31*/
1div.a {
2 width: 150px;
3 height: 80px;
4 background-color: yellow;
5 -ms-transform: rotate(20deg); /* IE 9 */
6 transform: rotate(20deg);
7}
8
9<h2>transform: rotate(20deg):</h2>
10<div class="a">Hello World!</div>
11<br>