how to flip glyphicon icon

70,987

Solution 1

Like this

HTML

<a href="#" class="btn"><i class="icon-rotate icon-flipped"></i></a>

CSS

.icon-flipped {
    transform: scaleX(-1);
    -moz-transform: scaleX(-1);
    -webkit-transform: scaleX(-1);
    -ms-transform: scaleX(-1);
}

OR

http://fortawesome.github.io/Font-Awesome/examples/#rotated-flipped

Solution 2

Using glyphicons managed to make this work like so:

HTML

<span class="glyphicon glyphicon-search" id="my-glyphicon"></span>

CSS

#my-glyphicon {
        -moz-transform: scaleX(-1);
        -o-transform: scaleX(-1);
        -webkit-transform: scaleX(-1);
        transform: scaleX(-1);
        filter: FlipH;
        -ms-filter: "FlipH";
}

see JSFiddle here

Share:
70,987

Related videos on Youtube

Jamol
Author by

Jamol

Hardworking, punctual and well-organized.

Updated on September 06, 2020

Comments

  • Jamol
    Jamol almost 4 years

    Is there any way to flip glyphicon. I found Flip an Image css trick, but that does not work for glyphicon. Please any suggestions

  • Jamol
    Jamol almost 11 years
    This didn`t work. I am not using fontawesome. I am using glyphicons
  • corinnaerin
    corinnaerin almost 9 years
    This worked for me and I'm using glyphicons (via twitter bootstrap) too
  • Berty
    Berty over 8 years
    You should keep in mind to put the real css property last in the list since this could in some cases cause a render differance: css-tricks.com/ordering-css3-properties
  • MonsterMMORPG
    MonsterMMORPG almost 8 years
    i wish it has more elegant solution via an embedded class. so bootstrap does not have such class to rotate right?
  • Jax
    Jax almost 8 years
    @MonsterMMORPG not that I'm aware of.
  • Leopoldo Sanczyk
    Leopoldo Sanczyk over 7 years
    @jCloud to use this solution with Bootstrap Glyphicons you should do like this: <a href="#" class="btn"><span class="glyphicon glyphicon-repeat icon-flipped"></span></a>. Sorry for coding in the comments, my edits were rejected.
  • getName
    getName over 5 years
    I tried to apply this to iron-icon (which is icon components for Polymer) and it didn't work!! @falguni-panchal do you have an idea ? inside the component there is an svg icon btw