transform失效了?iconfont字体图标无法旋转,无法缩放?的解决办法

版权声明:本文为博主原创文章,码字不易,转载请先经本人同意。 https://blog.csdn.net/promiseCao/article/details/82757251

其实只要是 transform 性的内容运用在 iconfont 图标上都是无效的

原因

查参考手册,transform适用于:所有块级元素及某些内联元素

css参考手册

A transformable element is an element in one of these categories:
an element whose layout is governed by the CSS box model which is either a block-level or atomic inline-level element, or whose display property computes to table-row, table-row-group, table-header-group, table-footer-group, table-cell, or table-caption [CSS21]
an element in the SVG namespace and not governed by the CSS box model which has the attributes transform, ‘patternTransform‘ or gradientTransform[SVG11].

 解决方案:

既然 transform 不适用于某些内联元素,那咱们就把这些元素变成 inline-blockblock 就行了。

猜你喜欢

转载自blog.csdn.net/promiseCao/article/details/82757251