Class Selectors
Class selectors target elements with a specific class attribute. They start with a dot (.).
Basic Class Selectors
Loading Selector Playground...
Try these class selectors:
.highlight- elements with class "highlight".container- elements with class "container".important- elements with class "important"
Multiple Classes
An element can have multiple classes. You can select elements with specific combinations:
Loading Selector Playground...
.text.large- elements with BOTH "text" and "large" classes.large.bold- elements with BOTH "large" and "bold" classes
Styling with Class Selectors
Loading CSS Playground...
Element + Class Combination
You can combine element and class selectors:
Loading Selector Playground...
p.special- only<p>elements with class "special"
Exercise: Style a Button
Add styles to elements with the "button" class:
Loading CSS Exercise...
التالي · الدرس 4 من 27
ID Selectors
قراءة 1 دقيقة
أنهيت 3 من 27 درسًا

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

