# attribute selectors
**版本:CSS3**
繼承性:無
### 說明:
子串匹配的屬性選擇器,具體規則與正則中的匹配相似。
### 對照表:
| 選擇符類型 | 表達式 | 描述 |
|-----|-----|-----|
| 子串匹配的屬性選擇符 | [E[att^="val"]](#) | 匹配具有att屬性、且值以val開頭的E元素 |
| 子串匹配的屬性選擇符 | [E[att$="val"]](#) | 匹配具有att屬性、且值以val結尾的E元素 |
| 子串匹配的屬性選擇符 | [E[att*="val"]](#) | 匹配具有att屬性、且值中含有val的E元素 |
| 結構性偽類 | [E:root](#) | 匹配文檔的根元素。在HTML中,根元素永遠是HTML |
| 結構性偽類 | [E:nth-child(n)](#) | 匹配父元素中的第n個子元素E |
| 結構性偽類 | [E:nth-last-child(n)](#) | 匹配父元素中的倒數第n個結構子元素E |
| 結構性偽類 | [E:nth-of-type(n)](#) | 匹配同類型中的第n個同級兄弟元素E |
| 結構性偽類 | [E:nth-last-of-type(n)](#) | 匹配同類型中的倒數第n個同級兄弟元素E |
| 結構性偽類 | [E:last-child](#) | 匹配父元素中最后一個E元素 |
| 結構性偽類 | [E:first-of-type](#) | 匹配同級兄弟元素中的第一個E元素 |
| 結構性偽類 | [E:only-child](#) | 匹配屬于父元素中唯一子元素的E |
| 結構性偽類 | [E:only-of-type](#) | 匹配屬于同類型中唯一兄弟元素的E |
| 結構性偽類 | [E:empty](#) | 匹配沒有任何子元素(包括text節點)的元素E |
| 目標偽類 | [:target](#) | 匹配相關URL指向的E元素 |
| UI元素狀態偽類 | [E:enabled](#) | 匹配所有用戶界面(form表單)中處于可用狀態的E元素 |
| UI元素狀態偽類 | [E:disabled](#) | 匹配所有用戶界面(form表單)中處于不可用狀態的E元素 |
| UI元素狀態偽類 | [E:checked](#) | 匹配所有用戶界面(form表單)中處于選中狀態的元素E |
| UI元素狀態偽類 | [E::selection](#) | 匹配E元素中被用戶選中或處于高亮狀態的部分 |
| 否定偽類 | [E:not(s)](#) | 匹配所有不匹配簡單選擇符s的元素E |
| 通用兄弟元素選擇器 | [E ~ F](#) | 匹配E元素之后的F元素 |
Copyright ? 2009 [Tencent ISD webteam](http://webteam.tencent.com/). All Rights Reserved
### 快速跳轉
- [說明](# "跳轉到“說明”")
- [對照表](# "跳轉到“對照表”")
- CSS3 Properties
- 邊框(Border)
- Border-color
- Border-image
- Border-radius
- box-shadow
- 背景(Background)
- background-origin
- background-clip
- Background-size
- Multiple backgrounds
- 顏色(Color)
- HSL colors
- HSLA colors
- opacity
- RGBA colors
- 文本(Text effects)
- text-shadow
- text-overflow
- word-wrap
- 用戶界面(User-interface)
- box-sizing
- resize
- outline
- outline-width
- outline-style
- outline-offset
- outline-color
- nav-index
- nav-up
- nav-right
- nav-down
- nav-left
- 基礎盒模型(Basic box model)
- overflow
- overflow-x
- overflow-y
- 內容(Generated Content)
- content
- 其它模塊(Other modules)
- media queries
- Speech
- columns
- column-width
- column-span
- column-rule
- column-rule-color
- column-rule-width
- column-rule-style
- column-gap
- column-fill
- column-count
- column-break-before
- column-break-after
- @font-face
- 選擇器(selectors)
- 子串匹配的屬性選擇符 E[att^="val"]
- 子串匹配的屬性選擇符 E[att$="val"]
- 子串匹配的屬性選擇符 E[att*="val"]
- 結構性偽類 E:root
- 結構性偽類 E:nth-child(n)
- 結構性偽類 E:nth-last-child(n)
- 結構性偽類 E:nth-of-type(n)
- 結構性偽類 E:nth-last-of-type(n)
- 結構性偽類 E:last-child
- 結構性偽類 E:first-of-type
- 結構性偽類 E:only-child
- 結構性偽類 E:only-of-type
- 結構性偽類 E:empty
- UI元素狀態偽類 E:checked
- UI元素狀態偽類 E:enabled
- UI元素狀態偽類 E:disabled
- UI元素狀態偽類 E::selection
- 否定偽類 E:not(s)
- 目標偽類 E:target
- 通用兄弟元素選擇器 E ~ F