Next-sibling Combinator (+)

W3C CSS Snapshot 2026

Parent တူတဲ့ element တွေထဲမှာ ရှေ့ element နောက် ကပ်လျက်မှာရှိတာကို ရွေးပါတယ်။

ဒီစာမျက်နှာမှာ

ရေးပုံနဲ့ သုံးလို့ရတဲ့ တန်ဖိုးများ

တန်ဖိုး သို့မဟုတ် ရေးပုံအလုပ်လုပ်ပုံ
h2 + pကပ်လျက်ရှေ့မှာ <h2> ရှိတဲ့ <p> ကိုပဲ ရွေးပါတယ်။

နမူနာကို စမ်းကြည့်ပါ

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Next-sibling Combinator (+)</title>
  <style>
h2 + p { color: teal; font-weight: bold; }
  </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 ထဲက ပထမစာပိုဒ်ပဲ ပြောင်းပါတယ်။ ဒုတိယစာပိုဒ်ရဲ့ ရှေ့မှာ မျဉ်းခြား <hr> ရှိလို့ မကိုက်ပါဘူး။

တရားဝင် ကိုးကားချက်များ