Issue making Bootstrap3 icon spin

前端 未结 7 2124
离开以前
离开以前 2021-02-03 17:59

Inspired by Fontawesome, I\'m trying to make a spinning icon with bootstrap3. It\'s easily achieve via CSS3 transition and transform. Problem is the icon does not not rotate aro

7条回答
  •  太阳男子
    2021-02-03 18:16

    The issue is that you rotate an element which is not centered in your span.

    If you want a real solution, add transform-origin on .spin to change the center of rotation

    .spin{
         -webkit-transform-origin: 50% 58%;
         transform-origin:50% 58%;
         -ms-transform-origin:50% 58%; /* IE 9 */
         -webkit-animation: spin .2s infinite linear;
         -moz-animation: spin .2s infinite linear;
         -o-animation: spin .2s infinite linear;
         animation: spin .2s infinite linear;
    }
    

    http://jsfiddle.net/L4zTu/5/

提交回复
热议问题