Sibling Combinators
Sibling combinators select elements based on their relationship to other elements at the same level.
Adjacent Sibling (+)
The + combinator selects the element immediately following another:
Loading Selector Playground...
h2 + p selects paragraphs that come directly after an h2.
General Sibling (~)
The ~ combinator selects all following siblings:
Loading Selector Playground...
h2 ~ p selects ALL paragraphs that follow h2 (not just adjacent).
Practical: Form Styling
Loading CSS Playground...
Styling Lists with Siblings
Loading CSS Playground...
Exercise: Style Adjacent Paragraph
Style the paragraph that immediately follows the heading:
Loading CSS Exercise...
التالي · الدرس 8 من 27
Attribute Selector Basics
قراءة 2 دقيقة
أنهيت 7 من 27 درسًا

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

