DW 視覺化介面產生的 CSS 規則順序為:
a:hover { color:#FF3333; text-decoration:underline; }
a:link { color:#3333FF; text-decoration:none; }
a:visited { color:#3333FF; text-decoration:none; }
實測 IE 中:已訪問連結滑鼠懸停時底線消失,違反預期。
:link、:visited、:hover、:active 四個偽類權重相同,後宣告者勝出。DW 預設將 :hover 放在最前面,導致 :visited 後宣告的 :hover 被覆蓋,結果「已訪問+懸停」狀態套用的是 :visited 的無底線樣式。
a:link { color:#3333FF; text-decoration:none; } /* L - Link */
a:visited { color:#3333FF; text-decoration:none; } /* V - Visited */
a:hover { color:#FF3333; text-decoration:underline; } /* H - Hover */
a:active { color:#FF0000; text-decoration:underline; } /* A - Active */
記憶口訣:LoVe HAte(愛恨交織),依序寫入即無誤。
補充:現代專案常用 CSS Reset/Normalize 已包含標準偽類順序,直接引用即可避開此坑。