I want to rotate this font icon 45 degrees. The icon has this CSS (all CSS compiled via LESS):
[class^="flaticon-"]:before, [class*=" flaticon-"]:before, [class^="flaticon-"]:after, [class*=" flaticon-"]:after { font-family: Flaticon; font-size: 20px; font-style: normal; margin-left: 20px; }
And it's this Flaticon: http://www.flaticon.com/free-icon/hand-pointer_70655
I've installed it as an icon font.
However, when I try to rotate it 45 degrees, so that the finger points to the top right corner, it doesn't work. I'm trying by installing the icon like so:
<i class="flaticon-hand-10 gly-rotate-45"></i>
Where this is the class gly-rotate-45
:
.gly-rotate-45 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0.5); -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); }
The browser is picking up transform: rotate(45deg);
, but the icon isn't rotated. How can I rotate this icon font?
Screen rotation for an Android smartphoneFrom the top-right of the screen, swipe down and to the left two times. This action brings up a small menu of icons. From the menu, tap the icon that says Auto-rotate, as shown in the images below.
To arbitrarily rotate and flip icons, use the fa-rotate-* and fa-flip-* classes when you reference an icon.
To arbitrarily rotate and flip icons, use the fa-rotate-* and fa-flip-* classes. does not work, whereas replacing fa-rotate-45 with fa-rotate-90 does.
You can rotate icon by 90, 180 and 270 degrees. To do that, add rotate attribute. Possible values: "90deg", "1": rotate by 90 degrees.
The reason why the icon does not rotate in it's 'raw' state is because it's default display
setting is inline
.
You cannot apply transforms to inline elements like this.
To solve the problem just apply `display:inline-block".
@font-face { font-family: 'Flaticon'; src: url('data:font/ttf;base64,AAEAAAANAIAAAwBQRkZUTWzLl7IAAAV4AAAAHEdERUYAMQAGAAAFWAAAACBPUy8yL7pL5QAAAVgAAABWY21hcMARI74AAAHAAAABSmdhc3D//wADAAAFUAAAAAhnbHlmwP2S0wAAAxgAAABwaGVhZARhaP0AAADcAAAANmhoZWED0gHFAAABFAAAACRobXR4BgAAHgAAAbAAAAAQbG9jYQA4AAAAAAMMAAAACm1heHAARwAoAAABOAAAACB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AAADAAEECQACAA4AGwADAAEECQADAEgAMwADAAEECQAEABAAogADAAEECQAFABYAvQADAAEECQAGABAA4QBmAGwAYQB0AGkAYwBvAG4AAGZsYXRpY29uAABSAGUAZwB1AGwAYQByAABSZWd1bGFyAABGAG8AbgB0AEYAbwByAGcAZQAgADIALgAwACAAOgAgAGYAbABhAHQAaQBjAG8AbgAgADoAIAAxADMALQA2AC0AMgAwADEANQAARm9udEZvcmdlIDIuMCA6IGZsYXRpY29uIDogMTMtNi0yMDE1AABmAGwAYQB0AGkAYwBvAG4AAGZsYXRpY29uAABWAGUAcgBzAGkAbwBuACAAMQAuADAAAFZlcnNpb24gMS4wAABmAGwAYQB0AGkAYwBvAG4AAGZsYXRpY29uAAAAAAIAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAgECBmhhbmQxMAAAAAAAAAH//wACAAEAAAAOAAAAGAAAAAAAAgABAAMAAwABAAQAAAACAAAAAAABAAAAAMmJbzEAAAAA0aEUQAAAAADRoRRA') format('truetype'); font-weight: normal; font-style: normal; } [class^="flaticon-"]:before, [class*=" flaticon-"]:before, [class^="flaticon-"]:after, [class*=" flaticon-"]:after { font-family: Flaticon; font-size: 20px; font-style: normal; margin-left: 20px; } .flaticon-hand-10:before { content: "\e000"; } .gly-rotate-45 { filter: progid: DXImageTransform.Microsoft.BasicImage(rotation=0.5); -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); display: inline-block; }
<i class="flaticon-hand-10 gly-rotate-45"></i>
The content (i.e. the icon) is being added by the CSS and can't be rotated on its own. (I'm trying to find the exact reason why, but I'm having trouble identifying if it's browser specific or not.)
Encapsulate the element in another element and rotate that one. You'll also need to set size boundaries otherwise it could have drastic results that you don't want.
@font-face { font-family: 'Flaticon'; src: url('data:font/ttf;base64,AAEAAAANAIAAAwBQRkZUTWzLl7IAAAV4AAAAHEdERUYAMQAGAAAFWAAAACB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ANBRsRDgwfLB8SDyshAg5zEjYYcS9CH9sHEhgIDxMIexYfHxbtFRADHSwQgRIaOyqBFh8AAAAAAAwAlgABAAAAAAABAAgAEgABAAAAAAACAAcAKwABAAAAAAADACQAfQABAAAAAAAEAAgAtAABAAAAAAAFAAsA1QABAAAAAAAGAAgA8wADAAEECQABABAAAAADAAEECQACAA4AGwADAAEECQADAEgAMwADAAEECQAEABAAogADAAEECQAFABYAvQADAAEECQAGABAA4QBmAGwAYQB0AGkAYwBvAG4AAGZsYXRpY29uAABSAGUAZwB1AGwAYQByAABSZWd1bGFyAABGAG8AbgB0AEYAbwByAGcAZQAgADIALgAwACAAOgAgAGYAbABhAHQAaQBjAG8AbgAgADoAIAAxADMALQA2AC0AMgAwADEANQAARm9udEZvcmdlIDIuMCA6IGZsYXRpY29uIDogMTMtNi0yMDE1AABmAGwAYQB0AGkAYwBvAG4AAGZsYXRpY29uAABWAGUAcgBzAGkAbwBuACAAMQAuADAAAFZlcnNpb24gMS4wAABmAGwAYQB0AGkAYwBvAG4AAGZsYXRpY29uAAAAAAIAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAgECBmhhbmQxMAAAAAAAAAH//wACAAEAAAAOAAAAGAAAAAAAAgABAAMAAwABAAQAAAACAAAAAAABAAAAAMmJbzEAAAAA0aEUQAAAAADRoRRA') format('truetype'); font-weight: normal; font-style: normal; } [class^="flaticon-"]:before, [class*=" flaticon-"]:before, [class^="flaticon-"]:after, [class*=" flaticon-"]:after { font-family: Flaticon; font-size: 20px; font-style: normal; margin-left: 20px; } .flaticon-hand-10:before { content: "\e000"; } .gly-rotate-45 { filter: progid: DXImageTransform.Microsoft.BasicImage(rotation=0.5); -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); -o-transform: rotate(45deg); transform: rotate(45deg); } p { max-width: 40px; max-height: 40px; }
<p class="gly-rotate-45"> <i class="flaticon-hand-10"></i> </p>
For now, that's my solution, but it feels clunky and I will continue to investigate a better answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With