| 類別 | 選擇器 | 範例 | 說明 |
| 基本 | * | * {margin:0} | 通用選擇器 |
E | p {color:red} | 標籤選擇器 |
.class | .info {background:#ff0} | 類別選擇器 |
#id | #footer {width:100%} | ID 選擇器 |
| 組合 | E, F | h1, h2 {color:red} | 群組選擇器 |
E F | div p {color:red} | 後代選擇器 (空格) |
E > F | ul > li {list-style:none} | 子代選擇器 |
E + F | h1 + p {margin-top:0} | 相鄰同層選擇器 |
| 屬性 (CSS2.1) | E[att] | p[title] {color:red} | 擁有屬性 |
E[att=val] | div[class=error] | 屬性完全等於 |
E[att~=val] | td[headers~=col1] | 屬性值空格分隔含 val |
E[att\|=val] | p[lang|=en] | 屬性值連字號分隔以 val 開頭 |
| 偽類 (CSS2.1) | E:first-child | p:first-child {font-style:italic} | 第一個子元素 |
E:link | a:link {color:blue} | 未訪問連結 |
E:visited | a:visited {color:purple} | 已訪問連結 |
E:hover | a:hover {color:red} | 滑鼠懸停 |
E:active | a:active {color:green} | 點擊瞬間 |
E:focus | input:focus {outline:2px solid blue} | 獲得焦點 |
| 偽元素 (CSS2.1) | E::first-line | p::first-line {font-weight:bold} | 第一行 |
E::first-letter | .drop::first-letter {font-size:2em} | 首字 |
E::before | .icon::before {content:"★"} | 插入前內容 |
E::after | a::after {content:" (" attr(href) ")"} | 插入後內容 |
| CSS3 同層 | E ~ F | h1 ~ p {color:gray} | 之後所有同層 F |
CSS3 屬性擴充:[att^=val] 開頭、[att$=val] 結尾、[att*=val] 含有 |
| CSS3 UI 偽類 | E:enabled | input:enabled | 啟用表單 |
E:disabled | input:disabled {background:#ddd} | 禁用表單 |
E:checked | input:checked + label {color:red} | 勾選狀態 |
E::selection | ::selection {background:yellow} | 使用者選取文字 |
| CSS3 結構偽類 | E:root | :root {--main:#333} | 文件根元素 |
E:nth-child(n) | tr:nth-child(2n) {background:#eee} | 第 n 個子元素 |
E:nth-last-child(n) | li:nth-last-child(1) | 倒數第 n 個 |
E:nth-of-type(n) | img:nth-of-type(3) | 同類型第 n 個 |
E:nth-last-of-type(n) | | 同類型倒數第 n |
E:last-child | | 最後一個子元素 |
E:first-of-type | | 同類型第一個 |
E:last-of-type | | 同類型最後一個 |
E:only-child | | 唯一子元素 |
E:only-of-type | | 同類型唯一 |
E:empty | div:empty {display:none} | 無子節點 (含文字) |
| 否定偽類 | E:not(s) | :not(p) {border:1px solid #ccc} | 排除符合 s |
| 目標偽類 | E:target | section:target {background:#ff9} | URL hash 指向元素 |