六角學院
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    5
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Google Fonts 載入教學 此幕資網站用了以下兩個字型,若您不想看以下教學,可以直複製以下程式碼 ``` css @import url(https://fonts.googleapis.com/earlyaccess/notosanstc.css); @import url(https://fonts.googleapis.com/css?family=Baloo+Tamma+2:600,700); ``` # 如何載入 Google Fonts? ### 進入 Google Fonts 點擊以下超連結進入 Google Fonts 首頁: [Google Fonts](https://fonts.google.com/) 進入 Google Fonts 首頁後看到的畫面如下: ![](https://i.imgur.com/FQLC3Sc.jpg) ### 尋找需要的字型: 以字型 Roboto 為例: ![](https://i.imgur.com/IvhmvWV.jpg) 可在 Google Fonts 首頁中的左上方的搜尋欄位尋找需要的字型: ![](https://i.imgur.com/QbqA39W.jpg) 在下方搜尋結果中找到需要的字型: ![](https://i.imgur.com/Kr2FbLk.jpg) 之後會進到該字型的詳細頁面: ![](https://i.imgur.com/1dB0us5.jpg) ### 確認需要的字型種類 ![](https://i.imgur.com/XIo35os.jpg) 會發現需要 Bold italic、Medium italic、Black italic 這三種字型種類, ### 將需要的字型種類加進已選取的字型清單中 將需要的字型加入已選取的字型清單中: 1. 確認需要的字型種類 2. 在確認需要的字型種類同一行的最右邊會有 + Select this style 按鈕可以將該種字型種類加進字型清單中 ![](https://i.imgur.com/OY2XjdE.jpg) 將需要的字型加入字體清單中後會看到網頁右方出現側邊攔(已選取的字型清單),可在清單中確認需要的字型: ![](https://i.imgur.com/NGh6c5W.jpg) 如果點擊 + Select this style 按鈕(超連結)後如果沒有出現右方側邊欄的字體清單的話可以點擊畫面裡右上方的圖標來開啟已選取的字型清單: ![](https://i.imgur.com/0qcX2a3.jpg) ### 在 HTML 中將 Google Fonts 的雲端字型檔載入 接著就準備將 Google Fonts 雲端字型檔載入到網頁中了, 先在已選取的字型清單中切換到 Embed 頁籤,點擊 Embed 頁籤可以進行內容切換: ![](https://i.imgur.com/ldYueIU.jpg) 以下有兩種方式可以將 Google Fonts 雲端字型檔載入網頁中, 選擇其中一個就可以了, #### 方法一 在 HTML head 標籤中使用 link 載入 預設情況下會出現以下 link 標籤,將 link 標籤整個複製起來, ![](https://i.imgur.com/op7deU1.jpg) 再將 link 標籤貼到 HTML 的 head 標籤裡來載入 Google Fonts 雲端字體: ![](https://i.imgur.com/D7Wg1Yd.jpg) ```htmlembedded= <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@1,500;1,700;1,900&display=swap" rel="stylesheet"> </head> ``` 再回到剛才的 Google Fonts 網頁中的已選取的字型清單中複製字型樣式: ![](https://i.imgur.com/GBotDKG.jpg) 如果網頁中的字型都要設置為相同的字型的話,可直接在 body 元素選擇器中設定字型樣式: ![](https://i.imgur.com/6wvA4Cr.jpg) ```css body { font-family: 'Roboto', sans-serif; } ``` [參考範例](https://codepen.io/yingming25/pen/mdeObrR) 如果要針對同一個標籤設定相同字型的話,可透過該標籤的元素選取器來設定: ![](https://i.imgur.com/aTKbDas.jpg) ```css h2 { font-family: 'Roboto', sans-serif; } ``` [參考範例](https://codepen.io/yingming25/pen/LYpRwdv) 如果不想把同一個標籤都設為相同字型,只想在某個元素上設定字型的話,可以透過 class 選取器來設定: ![](https://i.imgur.com/QBxmRmq.jpg) ```css .header-title { font-family: 'Roboto', sans-serif; } ``` [參考範例](https://codepen.io/yingming25/pen/LYpRwLq) 以上的 CopePen 範例都有事先在 CodePen 中的 HTML 右上角的齒輪設定裡的 head 區塊透過 link 標籤載入 Google Fonts 雲端字型檔: ![](https://i.imgur.com/UZHcVdq.jpg) 再把複製起來的 Google Fonts 雲端字型檔的 link 標籤加進 head 區塊中: ![](https://i.imgur.com/PqupnM5.jpg) 加入完後記得儲存: ![](https://i.imgur.com/mUkGyeA.jpg) #### 方法二 在 CSS 檔案中 @import Google fonts 雲端字型檔: 在 Google Fonts 的已選取的字型清單中的 Embed 頁籤中也可以透過 @import 的方式載入 Google fonts 雲端字型檔到 CSS 中, 首先在 Embed 頁籤中點擊 link 旁的 @import: ![](https://i.imgur.com/Pas0bN6.jpg) 將下方的 style 標籤複製起來: ![](https://i.imgur.com/9e7nXuW.jpg) 在 HTML 檔的 head 標籤中加入 style 標籤: ![](https://i.imgur.com/eolXPFR.jpg) ```htmlembedded= <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@1,500;1,700;1,900&display=swap'); </style> </head> ``` 如果是獨立的 CSS 檔案要使用這種方式的話需要把 @import 的字型檔加在所有其他選擇器設定樣式之前: ![](https://i.imgur.com/rHsWaou.jpg) ### 調整字體寬度 ![](https://i.imgur.com/wHBWYuX.jpg) 注意在 Google Fonts 已選取的字型清單中在 Medium、Bold、Black 旁邊都有數字: ![](https://i.imgur.com/kJEOBSH.jpg) Medium、Bold、Black 三種不同的字體寬度旁邊都有對應的 font-weight 數值,再依據字體寬度來設定到想要設定的元素上,可參考以下範例: [參考範例](https://codepen.io/yingming25/pen/pojNoLg?editors=1100) ### 調整字體樣式 預設情況下字體的樣式都是被設置為 `font-style: normal;` 的, 如果要將文字設為斜體可以將 font-style 設置為 `font-style: italic;` 來讓文字變成斜體,可參考以下範例: [參考範例](https://codepen.io/yingming25/pen/JjYEMYM?editors=1100)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully