使用 CSS 將滑鼠移到樣式連結上


要使用 CSS 將滑鼠移到樣式連結上,請使用 CSS 中的:hover 選擇器。你可以嘗試執行以下程式碼來實現:hover,選擇器,

示例

即時演示

<!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-06-2020

219 次瀏覽

開啟你的 職業

完成課程以獲得認證

開始
廣告
© . All rights reserved.