3月 12, 2020 CSS
### TL;DR

使用以下的 CSS 來把 Focus 時的邊框取消。

```css
input:focus, select:focus, textarea:focus, button:focus {

	outline: none;
}
```

### Focus Outline

Focus Outline 大概是 Chrome 最先有的東西 (筆者自己經驗),就是當使用者的 Cursor 放到 Text Input Field 上,該 DOM Element 的邊框就會有一個藍色的 Highlight 出現,像亮了燈一樣。

![](https://cdn.19site.net/files/b9/e6/b9e67a16-9d24-4a67-8516-fe62a26b9c50.png 'stack overflow 的 screen capture')

當 Search Box 被 Focus 時,就會有一個藍色的邊框包著,像亮了燈一樣。

### 把 Focus 的 Border 消除

我們可以透過使用以的 CSS 來把 Focus 的 Border 消除。

```css
input:focus, select:focus, textarea:focus, button:focus {

	outline: none;
}
```
過去文章
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)