【发布时间】:2021-12-31 05:31:54
【问题描述】:
我想改变宽度、高度并旋转正方形。我尝试使用内联样式提供样式,但它不起作用。我的代码如下:
component.ts:
import { faSquare } from '@fortawesome/free-solid-svg-icons';
faSquare =faSquare;
html:
<fa-icon [icon]="faSquare"</fa-icon>
【问题讨论】:
我想改变宽度、高度并旋转正方形。我尝试使用内联样式提供样式,但它不起作用。我的代码如下:
component.ts:
import { faSquare } from '@fortawesome/free-solid-svg-icons';
faSquare =faSquare;
html:
<fa-icon [icon]="faSquare"</fa-icon>
【问题讨论】:
您可以在图标内部提供内联样式,如下所示:
<fa-icon [icon]="faSquare" [styles]="{height: '40px', width: '40px', transform: 'rotate(25deg)'}"></fa-icon>
【讨论】:
component.ts:
import { faSquare } from '@fortawesome/free-solid-svg-icons';
faSquare =faSquare;
html:
<fa-icon [icon]="faSquare"</fa-icon>
【讨论】:
component.ts:
import { faSquare } from '@fortawesome/free-solid-svg-icons';
faSquare =faSquare;
html:
<fa-icon [icon]="faSquare" [styles]="
#change width, height
{height: '64px', width: '64px',
#rotate square
transform: 'rotate(30deg)'}">
</fa-icon>
【讨论】: