使用 CSS 設定滑鼠懸停時的樣式連結


要使用 CSS 設定滑鼠懸停時的連結樣式,請使用 CSS:hover 選擇器。您可以嘗試執行以下程式碼來實現:hover、selector

示例

實際演示

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

更新時間:30-Jun-2020

219 次檢視

開啟您的 職業生涯

完成課程,獲得認證

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