Subsequent-sibling Combinator (~)
W3C CSS Snapshot 2026
Parent တူပြီး ရှေ့ element နောက်ဘက်မှာရှိတဲ့ ကိုက်သမျှ element ကို ရွေးပါတယ်။ ကြားမှာ တခြား element ရှိလည်း ရပါတယ်။
Code စမ်းလို့ရတဲ့ သင်ခန်းစာ ဖွင့်ရန်
ဒီစာမျက်နှာမှာ
ရေးပုံနဲ့ သုံးလို့ရတဲ့ တန်ဖိုးများ
| တန်ဖိုး သို့မဟုတ် ရေးပုံ | အလုပ်လုပ်ပုံ |
|---|---|
h2 ~ p | <h2> နဲ့ parent တူပြီး နောက်ဘက်မှာရှိတဲ့ <p> အားလုံးကို ရွေးပါတယ်။ |
နမူနာကို စမ်းကြည့်ပါ
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Subsequent-sibling Combinator (~)</title>
<style>
h2 ~ p { color: teal; }
</style>
</head>
<body>
<section>
<h2>Workshop</h2>
<p>Registration opens Monday.</p>
<hr>
<p>Bring a notebook.</p>
</section>
<p>Outside the section.</p>
</body>
</html>
စမ်းကြည့်ရင် ဘာဖြစ်မလဲ Section ထဲက စာပိုဒ်နှစ်ခုလုံး စိမ်းပြာရောင် ဖြစ်ပါတယ်။ အပြင်က စာပိုဒ်က parent မတူပါဘူး။