要令到網站體驗去到唔同 Browser 都差唔多的話,咁用 Web font 就一定係個唔少得的步驟。

咁當中最簡單易用就係用 Google web font,一來唔洗錢,二來大家都用佢的話就可能已經有 Proxy 幫你 Cache 左,咁 Client Side 就唔洗再重新載入了。

### 用法

首先去呢度選返個你鍾意既字形先 : https://fonts.google.com/?noto.query=noto+

而我見到有 `Noto Sans Hong Kong` 用,咁就當然係諗都唔法諗就用呢個啦。

然後 embed 下面個 css 入去你個 template file 度。

```html

<link rel='preconnect' href='https://fonts.googleapis.com' />

<link rel='preconnect' href='https://fonts.gstatic.com' crossorigin='' />

<link href='https://fonts.googleapis.com/css2?family=Berkshire+Swash&family=Noto+Sans+HK:wght@100..900&family=Noto+Serif:ital,wght@0,100..900;1,100..900&display=swap' rel='stylesheet' />
```

再係 `style` 入面設定返字形套用的地方 :

```css
html, body, div, p, table, th, td {
	font-family: 'Noto Sans HK', sans-serif;
	font-optical-sizing: auto;
    font-style: normal;
}
```

咁就設定好了,再 Reload 一下你個網站,當堂唔同晒 !
過去文章
2025 (9)
4 (5)
3 (1)
2 (3)
2024 (25)
11 (3)
10 (3)
9 (1)
3 (18)
2022 (6)
10 (1)
6 (2)
5 (1)
3 (1)
1 (1)
2021 (21)
11 (7)
7 (1)
6 (2)
5 (2)
4 (6)
3 (2)
2 (1)
2020 (92)
12 (1)
11 (2)
10 (4)
9 (10)
8 (5)
7 (1)
6 (3)
5 (1)
4 (4)
3 (25)
2 (7)
1 (29)
2019 (57)
12 (25)
11 (7)
9 (25)