CSS -優先權、選取器、CSS reset # 優先權 優先權 * important >= animation > inline-style > ID > class > Tag > * > 繼承 `clor: aqua !important` * 兩者相同(分數)看順序 * (不算分): * > + ~ * # 選取器 組合式宣告 `p.amos#handsome{ ...略 }` 優先權分數 tag + id + class * :nth-child() & :nth-last-child() * :first-child & :last-child 頭尾選取器 * 直接看順序 * :first-of-type & :last-of-type 首項分類與尾首分類選取器 * :first-of-type先做分類,在挑順序 # 前綴字 各家瀏覽器單獨先出現功能 # box-model w + b + p + m content-box -> w padding-box border-box margin-box box-sizing: border-box /content-box 逗號避頭尾 問題:nth-child() # :偽元素