Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the direction of a font awesome icon?

I am using the font-awsome library to show a unlock icon .

So, By default the direction is in right direction, I want to change that to the left.

<i class="fas fa-unlock-alt"></i>

SO, is there any way through which I can change the direction of the unlock icon ?

like image 259
Ganesh Kaspate Avatar asked Jun 05 '19 08:06

Ganesh Kaspate


Video Answer


3 Answers

You can use the fa-flip-horizontal class as documented here.

<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/all.min.css" rel="stylesheet"/>

<i class="fas fa-unlock-alt"></i>
<i class="fas fa-unlock-alt fa-flip-horizontal"></i> 
like image 155
Robby Cornelissen Avatar answered Oct 17 '22 16:10

Robby Cornelissen


You can rotate and flip icons with font awesome. In your case you can try this:

<i class="fas fa-unlock-alt fa-flip-horizontal"></i>

Check out this link for more information https://fontawesome.com/how-to-use/on-the-web/styling/rotating-icons

like image 40
Ichraf Avatar answered Oct 17 '22 17:10

Ichraf


Considering the JS+SVG version you can use flip-h to flip the icon horizontally

<script defer src="https://use.fontawesome.com/releases/v5.8.1/js/all.js"></script>

<i class="fas fa-unlock-alt" data-fa-transform="flip-h"></i>

More details: https://fontawesome.com/how-to-use/on-the-web/styling/power-transforms

like image 36
Temani Afif Avatar answered Oct 17 '22 16:10

Temani Afif