una texto rotate rotar que imagen icono hacer grados gire girar elemento como animacion css rotation icons icon-fonts

texto - rotate css



¿Cómo puedo rotar un icono de fuente 45 grados? (2)

Problema

El contenido está agregando el contenido (es decir, el ícono) y no se puede rotar por sí solo. (Estoy tratando de encontrar la razón exacta del motivo, pero tengo problemas para identificar si es específico del navegador o no).

Solución

Encapsula el elemento en otro elemento y gira ese. También deberá establecer límites de tamaño, de lo contrario podría tener resultados drásticos que no desea.

@font-face { font-family: ''Flaticon''; src: url(''data:font/ttf;base64,AAEAAAANAIAAAwBQRkZUTWzLl7IAAAV4AAAAHEdERUYAMQAGAAAFWAAAACBPUy8yL7pL5QAAAVgAAABWY21hcMARI74AAAHAAAABSmdhc3D//wADAAAFUAAAAAhnbHlmwP2S0wAAAxgAAABwaGVhZARhaP0AAADcAAAANmhoZWED0gHFAAABFAAAACRobXR4BgAAHgAAAbAAAAAQbG9jYQA4AAAAAAMMAAAACm1heHAARwAoAAABOAAAACBuYW1liNt9UwAAA4gAAAGScG9zdJJ3apwAAAUcAAAAMQABAAAAAQAAIRWaJV8PPPUACwIAAAAAANGhFEAAAAAA0aEUQAAe/8AB4gHAAAAACAACAAAAAAAAAAEAAAHA/8AALgIAAAAAAAHiAAEAAAAAAAAAAAAAAAAAAAAEAAEAAAAEACUAAQAAAAAAAgAAAAEAAQAAAEAAAAAAAAAAAQIAAZAABQAIAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAIABQkAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUGZFZABA4ADgAAHA/8AALgHAAEAAAAABAAAAAAAAAgAAAAAAAAACAAAAAgAAHgAAAAMAAAADAAAAHAABAAAAAABEAAMAAQAAABwABAAoAAAABgAEAAEAAgAA4AD//wAAAADgAP//AAAgAwABAAAAAAAAAAABBgAAAQAAAAAAAAABAgAAAAIAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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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>

Por ahora, esa es mi solución, pero se siente torpe y continuaré investigando una mejor respuesta.

Quiero rotar este icono de fuente 45 grados. El icono tiene este CSS (todo el CSS compilado a través de MENOS):

[class^="flaticon-"]:before, [class*=" flaticon-"]:before, [class^="flaticon-"]:after, [class*=" flaticon-"]:after { font-family: Flaticon; font-size: 20px; font-style: normal; margin-left: 20px; }

Y es este Flaticon: http://www.flaticon.com/free-icon/hand-pointer_70655

Lo he instalado como una fuente de icono.

Sin embargo, cuando intento girarlo 45 grados, para que el dedo apunte a la esquina superior derecha, no funciona. Estoy intentando instalar el ícono así:

<i class="flaticon-hand-10 gly-rotate-45"></i>

Donde esta es la clase 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); }

El navegador está captando transform: rotate(45deg); , pero el icono no está girado. ¿Cómo puedo rotar esta fuente de icono?


La razón por la que el icono no gira en su estado "sin formato" es porque su configuración de display predeterminada es en inline .

No puede aplicar transformaciones a elementos en línea como este.

Para resolver el problema, simplemente aplique `display: inline-block".

@font-face { font-family: ''Flaticon''; src: url(''data:font/ttf;base64,AAEAAAANAIAAAwBQRkZUTWzLl7IAAAV4AAAAHEdERUYAMQAGAAAFWAAAACBPUy8yL7pL5QAAAVg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Ag5zEjYYcS9CH9sHEhgIDxMIexYfHxbtFRADHSwQgRIaOyqBFh8AAAAAAAwAlgABAAAAAAABAAgAEgABAAAAAAACAAcAKwABAAAAAAADACQAfQABAAAAAAAEAAgAtAABAAAAAAAFAAsA1QABAAAAAAAGAAgA8wADAAEECQABABAAAAADAAEECQACAA4AGwADAAEECQADAEgAMwADAAEECQAEABAAogADAAEECQAFABYAvQADAAEECQAGABAA4QBmAGwAYQB0AGkAYwBvAG4AAGZsYXRpY29uAABSAGUAZwB1AGwAYQByAABSZWd1bGFyAABGAG8AbgB0AEYAbwByAGcAZQAgADIALgAwACAAOgAgAGYAbABhAHQAaQBjAG8AbgAgADoAIAAxADMALQA2AC0AMgAwADEANQAARm9udEZvcmdlIDIuMCA6IGZsYXRpY29uIDogMTMtNi0yMDE1AABmAGwAYQB0AGkAYwBvAG4AAGZsYXRpY29uAABWAGUAcgBzAGkAbwBuACAAMQAuADAAAFZlcnNpb24gMS4wAABmAGwAYQB0AGkAYwBvAG4AAGZsYXRpY29uAAAAAAIAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAgECBmhhbmQxMAAAAAAAAAH//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>