How to rotate 180 deg a fontawesome icon?
Asked Answered
T

4

8

can any one tell me that how can i rotate a font awesome icon 180 degree. Actually i want to use a truck icon which is directed to right side but i found it left side rotated.

For ex:- <i class="fa fa-truck"></i>
Thermogenesis answered 21/4, 2018 at 7:50 Comment(2)
The rotate() CSS function defines a transformation that rotates an element around a fixed point.Suzerainty
seriously ? is it difficult to first ask google ? ...Ama
C
13

This helped me:

.fa {
    -webkit-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
    -ms-transform: rotate(180deg);
    -o-transform: rotate(180deg);
    transform: rotate(180deg);
}
Cassaba answered 21/4, 2018 at 7:54 Comment(0)
B
13

Use transform css to achieve this:

.fa {
  transform: rotateZ(180deg);
}
Beatify answered 21/4, 2018 at 7:53 Comment(1)
yes it will work, try this, you can add browser prefixes if you wantBeatify
C
13

This helped me:

.fa {
    -webkit-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
    -ms-transform: rotate(180deg);
    -o-transform: rotate(180deg);
    transform: rotate(180deg);
}
Cassaba answered 21/4, 2018 at 7:54 Comment(0)
F
2

Just add the class 'fa-rotate-180'

Faxan answered 27/11, 2023 at 9:19 Comment(0)
A
0

You can use the transform css option combine it with rotate() function. See it in action

Adalia answered 21/4, 2018 at 8:0 Comment(2)
that example does not do anythingPinnate
@Pinnate it actually does! It rotates the icon with CSS. Go to the CSS tab and comment out the code to see the differenceAdalia

© 2022 - 2024 — McMap. All rights reserved.