ID Selector (#)
W3C CSS Snapshot 2026
ID နာမည်ရှေ့မှာ # ထည့်ပါ။ ID တန်ဖိုးတစ်ခုကို document ထဲက element တစ်ခုမှာပဲ သုံးပါ။
Code စမ်းလို့ရတဲ့ သင်ခန်းစာ ဖွင့်ရန်
ဒီစာမျက်နှာမှာ
ရေးပုံနဲ့ သုံးလို့ရတဲ့ တန်ဖိုးများ
| တန်ဖိုး သို့မဟုတ် ရေးပုံ | အလုပ်လုပ်ပုံ |
|---|---|
#location | id="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 လို့ ရေးထားတဲ့ စာပိုဒ်တစ်ခုတည်း ပြောင်းပါမယ်။