a → 確定。text-decoration: none)。a:hover → 設定 顏色(如紅色),若需背景色同步在「背景」分類設定。a { text-decoration: none; color: #0066cc; }
a:hover { color: #ff0000; background-color: #ffffcc; }
直接撰寫 CSS 檔案更彈性,並可擴充 :focus、:active、:visited 狀態,配合過渡動畫提升體驗:
a { transition: color .2s, background .2s; }