# Font Awesome ### 在web中使用免費icon ###### #icon #html #style --- Font Awesome 是一個提供icon的網站 免費的會員就有很多能用的icon。 在不想自己畫icon時,可以上來找資源。 --- ## How to Use ### 1. 註冊帳號 #### Font Awesome: https://fontawesome.com/ #### 直接使用e-mail註冊就好 ### 2. 找出自己的CDN 並貼到HTML ![](https://i.imgur.com/zY9PFkp.png) ![](https://i.imgur.com/tJQEKcZ.png) ![](https://i.imgur.com/Oa0u5BZ.png) ### 3. 找想要的ICON (注意版本) #### 到icon區 #### icon區網站:https://fontawesome.com/icons?d=gallery&p=2 ![](https://i.imgur.com/ZLtStP7.png) #### 找到icon點進去後 複製html tag ![](https://i.imgur.com/NuRBMpg.png) #### 貼到html想放的地方 ![](https://i.imgur.com/kdNYIe1.png) --- ## Use in React ### 1. 下載資源 用npm下載以下3個資料包 ``` npm i --save @fortawesome/fontawesome-svg-core npm install --save @fortawesome/free-solid-svg-icons npm install --save @fortawesome/react-fontawesome ``` ### 2. 匯入icon ``` import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { 'icon名稱' } from "@fortawesome/free-solid-svg-icons"; ``` ### 3. 使用icon 在要使用處輸入: ``` <FontAwesomeIcon icon={ 'icon名稱' } /> ``` ## END