:where()

W3C CSS Snapshot 2026

စာရင်းထဲက တစ်ခုခုနဲ့ ကိုက်ရင် ရွေးပါတယ်။ အထဲက selector တွေရဲ့ specificity ကို ထည့်မတွက်ပါဘူး။

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

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

တန်ဖိုး သို့မဟုတ် ရေးပုံအလုပ်လုပ်ပုံ
:where(p, .notice)စာပိုဒ်နဲ့ notice class ပါတာကို ရွေးပါတယ်။ ဒီ function ရဲ့ specificity က သုညပါ။

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

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>:where()</title>
  <style>
.notice { color: teal; }
:where(p, .notice) { color: purple; }
  </style>
</head>
<body>
<p class="notice">Registration opens Monday.</p>
<p id="location">Meet in Room 2.</p>
<h2>Workshop</h2>
</body>
</html>

စမ်းကြည့်ရင် ဘာဖြစ်မလဲ Notice မှာ class rule က specificity ပိုများလို့ စိမ်းပြာရောင် ဖြစ်ပါတယ်။ ကျန်တဲ့ စာပိုဒ်က ခရမ်းရောင် ဖြစ်ပါမယ်။

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