1.rotateimg180 {
2 -webkit-transform:rotate(180deg);
3 -moz-transform: rotate(180deg);
4 -ms-transform: rotate(180deg);
5 -o-transform: rotate(180deg);
6 transform: rotate(180deg);
7}
1.my-div{
2 transform: rotate(90deg); /* rotate x-axis and y-axis */
3 transform: rotateX(180deg); /* rotate x-axis */
4 transform: rotateY(180deg); /* rotate y-axis */
5}
1<style>
2div {
3 width: 80px;
4 height: 80px;
5 background-color: skyblue;
6}
7.rotated {
8 transform: rotate(45deg);
9 background-color: pink;
10}
11</style>
12
13/* In body of html doc */
14<div>Normal</div>
15<div class="rotated">Rotated</div>
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*/