Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

จัดสไตล์ลิงก์เมื่อ hover ด้วย CSS


Pseudo-class :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>