HTML <main> Tag
ဥပမာ
စာရွက်စာတမ်း၏ အဓိကအကြောင်းအရာကို သတ်မှတ်ပါ-
<main>
<h1>Most Popular Browsers</h1>
<p>Chrome, Firefox, and
Edge are the most used browsers today.</p>
<article>
<h2>Google Chrome</h2>
<p>Google Chrome is a web browser
developed by Google, released in 2008. Chrome is the world's most popular web
browser today!</p>
</article>
<article>
<h2>Mozilla
Firefox</h2>
<p>Mozilla Firefox is an open-source web browser developed by
Mozilla. Firefox has been the second most popular web browser since January,
2018.</p>
</article>
<article>
<h2>Microsoft Edge</h2>
<p>Microsoft Edge is a web browser developed by Microsoft, released in 2015.
Microsoft Edge replaced Internet Explorer.</p>
</article>
</main>
အောက်တွင် နောက်ထပ် "စမ်းသုံးကြည့်ပါ" ဥပမာများ။
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
တက်ဂ်သည် စာရွက်စာတမ်းတစ်ခု၏ အဓိက <main>
အကြောင်းအရာကို သတ်မှတ်သည်။
ဒြပ်စင် အတွင်းရှိ အကြောင်းအရာ <main>
သည် စာရွက်စာတမ်းအတွက် သီးသန့်ဖြစ်သင့်သည်။ ဘေးဘားများ၊ လမ်းညွှန်လင့်ခ်များ၊ မူပိုင်ခွင့်အချက်အလက်၊ ဆိုက်လိုဂိုနှင့် ရှာဖွေမှုပုံစံများကဲ့သို့သော စာရွက်စာတမ်းများတွင် ထပ်တလဲလဲပြုလုပ်ထားသည့် မည်သည့်အကြောင်းအရာမျှ မပါဝင်သင့်ပါ။
မှတ်ချက်-<main>
စာရွက်စာတမ်း တစ်ခုတွင် အစိတ်အပိုင်းတစ်ခုထက်ပို၍ မပါဝင်ရပါ ။ ဒြပ်စင် သည် <main>
<article>၊ <aside>၊ <footer>၊ <header> သို့မဟုတ် <nav> ဒြပ်စင်မှ ဆင်းသက်လာသူ မဟုတ်ရပါ။
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် ဒြပ်စင်ကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။
Element | |||||
---|---|---|---|---|---|
<main> | 26.0 | 12.0 | 21.0 | 7.0 | 16.0 |
ကမ္ဘာလုံးဆိုင်ရာ အရည်အချင်းများ
<main>
tag သည် HTML တွင် Global Attributes ကို ပံ့ပိုး ပေးပါသည်။
ဖြစ်ရပ်ဂုဏ်တော်များ
<main>
tag သည် HTML ရှိ Event Attributes ကိုလည်း ပံ့ပိုး ပေးပါသည် ။
နောက်ထပ် ဥပမာများ
ဥပမာ
<ပင်မ> ဒြပ်စင်ကို ပုံစံဆင်ရန် CSS ကို အသုံးပြုပါ-
<html>
<head>
<style>
main {
margin: 0;
padding: 5px;
background-color: lightgray;
}
main
> h1, p, .browser {
margin: 10px;
padding: 5px;
}
.browser {
background: white;
}
.browser > h2,
p {
margin: 4px;
font-size: 90%;
}
</style>
</head>
<body>
<main>
<h1>Most
Popular Browsers</h1>
<p>Chrome, Firefox, and Edge are the
most used browsers today.</p>
<article class="browser">
<h2>Google Chrome</h2>
<p>Google Chrome is a web browser
developed by Google, released in 2008. Chrome is the world's most popular web
browser today!</p>
</article>
<article class="browser">
<h2>Mozilla Firefox</h2>
<p>Mozilla Firefox is an
open-source web browser developed by Mozilla. Firefox has been the second most
popular web browser since January, 2018.</p>
</article>
<article class="browser">
<h2>Microsoft Edge</h2>
<p>Microsoft Edge is a web browser developed by Microsoft, released in 2015.
Microsoft Edge replaced Internet Explorer.</p>
</article>
</main>
</body>
</html>