跳至內容

「Template:Fa/doc」:修訂間差異

勤求古訓,博采眾方
第81行: 第81行:


==参数列表==
==参数列表==
{| class="wikitable mw-collapsible mw-collapsed" style="width:100%;text-align:center;margin-top:20px;font-size:12px"
{| class="wikitable mw-collapsible mw-collapsed" style="width:100%; margin-top:20px; font-size:12px; border-collapse:collapse;"
|-
|-
!常用图标
! style="text-align:center; padding:8px; background:#f5f5f5;" | 常用图标
|-
|-
|
| style="padding:10px; text-align:left; /* 修复列表符号对齐 */" |
{{columns-list|
{{columns-list|
cols=3|  <!-- 指定3列布局 -->
cols=3|  <!-- 3列布局,适配大多数屏幕 -->
colwidth=12em|  <!-- 列宽适配图标+代码块 -->
colwidth=calc(33.33% - 10px)|  <!-- 自适应列宽,避免溢出 -->
rules=solid|  <!-- 显示列分隔线,直观确认3列 -->
rules=none|  <!-- 隐藏列分隔线(视觉更简洁如需保留可改solid) -->
style=width:100%;|  <!-- 占满容器宽度,优化适配 -->
style=width:100%; margin:0; padding:0; list-style-position:inside;|  <!-- 关键对齐修复 -->
| style="padding:10px; text-align:left; max-height:400px; overflow-y:auto;" |
*{{fa|glass}} <code>glass</code>
*{{fa|glass}} <code>glass</code>
*{{fa|music}} <code>music</code>
*{{fa|music}} <code>music</code>

於 2025年11月27日 (四) 09:31 的修訂

本模版可以生成一個FontAwesome符號庫中的符號。

請在參數1中填寫所需的符號標識。

符號標識可以前往Font Awesome官網查詢。

使用方法

在參數1中填寫標識即可。

  • 設置
  • 郵箱
  • 歷史
  • 警告
  • 選擇
*{{fa|cog}}设置
*{{fa|envelope}}邮箱
*{{fa|history}}历史
*{{fa|warning}}警告
*{{fa|check-square}}选择

生成的符號是inline-block對象,顏色和大小與當前區域的文字一致。除了<nowiki>標籤之外,你可以像處理文字一樣處理這些符號。

為了美觀,建議在該模板和文字之間增加一個空格。

你甚至可以將本模板插入鏈接的顯示文本中。

例:請閱讀 Font Awesome快速引用模板文檔

请阅读[[模板:fa/doc|{{fa|flag}} Font Awesome快速引用模板文档]]

樣式

默認使用 fa 樣式。

在圖標名後的任何位置加入s、r、b參數,將對應使用 fas、far、fab 樣式(即 Solid、Regular、Brands 樣式)。


在圖標名後的任何位置加入沒有參數名的參數,將視為類(class)。

這種參數只能存在一個。如果你需要使用多個類,請寫在同一個參數中,並使用空格分隔。


此外,還有如下可選參數(不能省略參數名):

|rotate=圖標旋轉的角度(限制填寫90、180、270)

|color=圖標的顏色

|size=圖標的尺寸

|style=圖標的其他CSS樣式(不要使用引號)

範例

{{fa|qrcode}}

{{fa|qq|b|size=36px|color=skyblue}}

{{fa|adjust|size=24px|color=red|style=text-shadow: 2px 2px 6px #000; border:solid 1px blue; padding:10px; }}

圖標動畫

使用classfa-spin可以使任何圖標執行旋轉動畫,使用classfa-pulse可以使圖標以8步為周期進行旋轉。可以完美執行旋轉動畫的圖標有:fa-spinnerfa-refreshfa-cog

{{fa|spinner|fa-spin}}
{{fa|circle-o-notch|fa-spin}}
{{fa|refresh|fa-spin}}
{{fa|cog|fa-spin}}
{{fa|spinner|fa-pulse}}

{{fa|spinner|color=#666600|fa-3x fa-spin}}

常用圖標


anchor

archive

asterisk

at

ban

bell

binoculars

bolt

book

bookmark

box

bug

bullhorn

burn

certificate

chart-pie

check

chess-king

chess-knight

chess-queen

code

code-branch

coffee

comment

compress

crosshairs

desktop

door-open

dove

edit

eject

exclamation

exclamation-triangle

eye

feather

fighter-jet

filter

flag

flag-checkered

font

gamepad

gem

gift

glasses

graduation-cap

hashtag

heart

h-square

inbox

infinity

info

key

lightbulb

link

location-arrow

magic

map-marker-alt

map-signs

meh

moon

palette

play

poo

quote-left

robot

search

share-alt

shield-alt

shopping-cart

skull

star

stopwatch

subway

sun

tag

thumbs-down

thumbs-up

thumbtack

trophy

user-secret

wrench


參數列表

常用圖標
腳本運行超時。