6

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 ?

Temani Afif
  • 245,468
  • 26
  • 309
  • 415
ganesh kaspate
  • 1
  • 9
  • 41
  • 88

3 Answers3

9

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> 
Robby Cornelissen
  • 91,784
  • 22
  • 134
  • 156
3

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

lealceldeiro
  • 14,342
  • 6
  • 49
  • 80
Ichraf
  • 345
  • 1
  • 7
1

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

Temani Afif
  • 245,468
  • 26
  • 309
  • 415