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

266 次瀏覽

開啟你的 職業生涯

完成課程獲得認證

開始
廣告
© . All rights reserved.