iconfont font icon rotation - Stack Overflow
学习ing
学习ing 2017-06-26 10:52:06
0
4
1220
.rotate{transform: rotate(90deg)}

The icon is not rotated on the page. You are using the Chrome browser. Can you tell me why?
Is it true that Alibaba’s vector icons do not support rotation

Thank you, there is still no change in the page

学习ing
学习ing

reply all (4)
迷茫

First of all, you should download the source code of Alibaba iconfont. There isdemo_fontclass.htmlin the source code package, which contains the class name and usage instructions of the icon characters you need.
Here are some brief instructions:

After introducing theiconfont.cssin the downloaded package, you need to enterclass="iconfont icon-xxx"to use the iconfont font. For the specific icon-xxx, please refer to thedemo_fontclass.htmlfile, which is based on your packaging Depends.

Secondly, if you just need to rotate the icon, please change.rotateto.rotate:before, because iconfont is an icon added to the element through thecontentCSS attribute of the:beforepseudo element.

Update

Get the code first

       
  1. First of all, the implementation of the icon is controlled by:beforepseudo-element

  2. :beforepseudo-element is an inline element by default (i.e.display: inline)

  3. The rotation of inline elements is invalid, so you need to adddisplay: inline-blockto the.rotate:beforepseudo-element to make it an inline block element.

The effect of the above HTML code is as follows:

    Ty80

    transform does not support inline elements~

      学习ing

      My test is supported.

        世界只因有你

        Are you sure you can’t rotate? ? I tried it and it works

          Latest Downloads
          More>
          Web Effects
          Website Source Code
          Website Materials
          Front End Template
          About us Disclaimer Sitemap
          php.cn:Public welfare online PHP training,Help PHP learners grow quickly!