CSS :hover 選擇器的作用


使用 CSS :hover 選擇器用 CSS 在滑鼠懸停時設定連結樣式。你可以嘗試執行以下程式碼來實現 :hover 選擇器 −

示例

即時演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         a:hover {
            background-color: orange;
         }
      </style>
   </head>
   <body>
      <a href = "https://www.qries.com">Qries</a>
      <p>Keep the mouse cursor on the above link and see the effect.</p>
   </body>
</html>

更新於: 30-6 月-2020

266 次瀏覽

開啟你的 職業生涯

完成課程可獲得認證

開始學習
廣告
© . All rights reserved.