ID Selector (#)

W3C CSS Snapshot 2026

ID နာမည်ရှေ့မှာ # ထည့်ပါ။ ID တန်ဖိုးတစ်ခုကို document ထဲက element တစ်ခုမှာပဲ သုံးပါ။

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

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

တန်ဖိုး သို့မဟုတ် ရေးပုံအလုပ်လုပ်ပုံ
#locationid="location" ပါတဲ့ element ကို ရွေးပါတယ်။
p#locationအဲဒီ ID ပါပြီး <p> လည်း ဖြစ်မှ ရွေးပါတယ်။

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

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

စမ်းကြည့်ရင် ဘာဖြစ်မလဲ Room 2 လို့ ရေးထားတဲ့ စာပိုဒ်တစ်ခုတည်း ပြောင်းပါမယ်။

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