我想将我的字体超赞的图标静态旋转45度.网站上写着:

要任意旋转和翻转图标,请使用fa-Rotate-*和fa-flip-*类.

然而,做一件事

<i class="fa fa-link fa-rotate-45" style="font-size:1.5em"></i>

不起作用,而用fa-rotate-90代替fa-rotate-45起作用.这是否意味着它们实际上不能任意旋转?

推荐答案

Before FontAwesome 5:

标准声明只包含.fa-rotate-90.fa-rotate-180.fa-rotate-270. 但是,您可以轻松创建自己的:

.fa-rotate-45 {
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    -o-transform: rotate(45deg);
    transform: rotate(45deg);
}

With FontAwesome 5:

你可以使用所谓的"能量变换".示例:

<i class="fas fa-snowman" data-fa-transform="rotate-90"></i>
<i class="fas fa-snowman" data-fa-transform="rotate-180"></i>
<i class="fas fa-snowman" data-fa-transform="rotate-270"></i>
<i class="fas fa-snowman" data-fa-transform="rotate-30"></i>
<i class="fas fa-snowman" data-fa-transform="rotate--30"></i>

您需要添加值为rotate-data-fa-transform属性和所需的旋转(以度为单位).

来源:https://fontawesome.com/how-to-use/on-the-web/styling/power-transforms

Css相关问答推荐

Tailwind仅在启用时才在按钮上设置group-hover

Css-如何隐藏WP管理菜单上没有css类的第4<;li&>

输入中的框始终显示在MUI文本字段中

将特定样式应用于递归Angular 元素

如何使按钮:之后像按钮:之前一样可见

为什么删除 AnimatePresence framer.div 时会出现轻微卡顿?

测试响应式设计:手动拖动浏览器窗口与使用设备工具栏

应用边框半径的 iframe 在 4 个角上有细曲线

如何禁用 Angular Material Pagination 按钮的波纹效果?

网格区域即使使用 fr 也不会减小其宽度

如何应用适当样式的元素加消息框?

左右卡片的 OwlCarousel 导航:react js

基于内容显示(show)/隐藏(hide)同级div

为什么我们将