Hover and Focus States
Pseudo-classes let you style elements based on their state, like when hovered or focused.
The :hover Pseudo-class
Style elements when the mouse is over them:
Loading CSS Playground...
The :focus Pseudo-class
Style elements when they have keyboard focus:
Loading CSS Playground...
The :active Pseudo-class
Style elements while being clicked:
Loading CSS Playground...
Link States
Links have special pseudo-classes for their states:
Loading CSS Playground...
Card Hover Effects
Loading CSS Playground...
Focus-Visible
:focus-visible only shows focus styles for keyboard navigation:
Loading CSS Playground...
Exercise: Style Button States
Create hover and focus styles for a button:
Loading CSS Exercise...
التالي · الدرس 11 من 27
Structural Pseudo-Classes
قراءة 2 دقيقة
أنهيت 10 من 27 درسًا

اسأل Byte عن هذا الدرس
محادثة خاصة حول هذا الدرس. قرأ Byte الدرس كاملًا، ويجيب خلال ثوانٍ، ويُظهر القسم الذي تأتي منه كل إجابة. يمكنك السؤال بأي لغة.
الأسئلة والأجوبة
أسئلة عامة حول هذا الدرس. يجيب AI Tutor فورًا بلغتك، ويراجع فريق FreeAcademy الإجابات، ويمكن لكل المتعلمين قراءتها.

