Thuta Learning
HTML
ProjectsWeb Developmentအခြေခံ

Final Checklist

HTMLသင်ခန်းစာ 3630 မိနစ်

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • Document အဆင့်မှာ doctype၊ lang၊ charset၊ viewport၊ title ငါးခုလုံး ရှိမရှိ စစ်နိုင်ဖို့
  • h1 တစ်ခု၊ heading အဆင့်မကျော်ခြင်း၊ landmark တွေ ဆိုတဲ့ structure check တွေ လုပ်နိုင်ဖို့
  • Validator ဖမ်းတဲ့ အမှားနဲ့ လူကိုယ်တိုင်ပဲ ဖမ်းနိုင်တဲ့ အမှားကို ခွဲခြားနိုင်ဖို့
  • Keyboard၊ 320px width နဲ့ 200% zoom test တွေကို အစဉ်လိုက် လုပ်နိုင်ဖို့

ရိုးရိုးလေး ရှင်းပြမယ်

ရိုးရိုးလေး ရှင်းရရင်

Pilot တွေက လေယာဉ်ပျံကို ဘယ်လောက်ပဲ ကျွမ်းကျင်ကျွမ်းကျင် ပျံမသန်းခင် checklist ကို တစ်ကြောင်းချင်း ဖတ်ပြီး စစ်ပါတယ်။ မှတ်ဉာဏ်ကို မယုံလို့ပါ။ Website launch လုပ်တာလည်း အတူတူပါပဲ။ ကိုယ့် screen ပေါ်မှာ လှနေတာက page ကောင်းပြီလို့ မဆိုလိုပါဘူး။

ဒီ lesson က HTML သင်ခန်းစာတွေ အားလုံးကို စစ်ဆေးချက် စာရင်းတစ်ခုအဖြစ် စုပေးပါတယ်။ အစက ဆုံး ငါးမိနစ်လောက်ပဲ ကြာပြီး ကျင့်သားရလာရင် page တိုင်းကို အလိုအလျောက်လိုလို စစ်လာနိုင်ပါတယ်။

Problem → Why → Solution

ပြဿနာ: ကိုယ့်စက်မှာ ကောင်းနေတဲ့ bakery page

အောက်က page ကို desktop browser မှာ ဖွင့်ရင် ခေါင်းစဉ်၊ ပုံ၊ link နဲ့ email box တွေ အကုန်ပေါ်ပါတယ်။ Developer က screenshot တစ်ပုံရိုက်ပြီး "ပြီးပါပြီ" လို့ ပို့လိုက်ပါတယ်။ ဒါပေမယ့် ဒီ page ထဲမှာ အမှား ဆယ်ခုလောက် ပုန်းနေပါတယ်။

Doctype မပါလို့ browser က quirks mode နဲ့ render လုပ်ပါတယ်။ Viewport မပါလို့ phone မှာ စာလုံးတွေ သေးသေးလေး ဖြစ်နေပါတယ်။ ပုံမှာ alt မရှိ၊ link စာသားက "Click here" ဖြစ်ပြီး email box မှာ label လည်း name လည်း မရှိပါဘူး။ Screen reader user တစ်ယောက်အတွက် ဒီ page က ပဟေဠိတစ်ခုပါပဲ။

bakery-before.html
<html>
<head>
  <title>Home</title>
</head>
<body>
  <div class="top"><b>Golden Crust Bakery</b></div>
  <h1>Fresh bread every morning</h1>
  <h1>Our breads</h1>
  <img src="sourdough.jpg">
  <h4>Opening hours</h4>
  <p>Mon-Sat, 7am-6pm. <a href="/menu.html">Click here</a></p>
  <input type="email" placeholder="Email for news">
  <button>Join</button>
</body>
</html>

ဘာကြောင့် screenshot က မလုံလောက်တာလဲ

Screenshot က screen အရွယ်အစား တစ်ခု၊ browser တစ်ခု၊ mouse သုံးတဲ့ user တစ်ယောက်ရဲ့ မြင်ကွင်းကိုပဲ ပြပါတယ်။ Heading အစဉ်၊ alt စာသား၊ label ချိတ်ဆက်မှု၊ keyboard focus နဲ့ quirks mode တွေက ပုံထဲမှာ မမြင်ရပါဘူး။ ဒါကြောင့် code ကိုယ်တိုင်ရယ်၊ tool ရယ်၊ keyboard ရယ်နဲ့ စစ်ရပါတယ်။

Core concept: အလွှာငါးခုနဲ့ စစ်ပါ

Checklist ကို အပေါ်ကနေ အောက်ကို အလွှာလိုက် စစ်ပါ။ အောက်ခံ အလွှာ မှားနေရင် အပေါ်က အလွှာတွေကို စစ်ရတာ အလကားဖြစ်လို့ပါ။ ဥပမာ doctype မပါရင် layout ကို ဘယ်လောက်ပဲ စစ်စစ် browser က quirks mode နဲ့ ဆွဲနေလို့ ရလဒ်က ယုံလို့မရပါဘူး။

၁။ Document

ပထမစာကြောင်းမှာ <!DOCTYPE html>၊ html tag မှာ lang၊ head ထဲမှာ meta charset="UTF-8"၊ viewport meta နဲ့ စာမျက်နှာကို ဖော်ပြတဲ့ title ရှိရပါမယ်။ Title က browser tab၊ bookmark နဲ့ search result မှာ ပေါ်လို့ "Home" လို စကားလုံးတစ်လုံးထက် ပိုတိကျရပါမယ်။

၂။ Structure

Page ရဲ့ အဓိကအကြောင်းအရာကို h1 တစ်ခုနဲ့ ပြောပြီး section တွေကို h2၊ အဲဒီအောက်က အပိုင်းတွေကို h3 နဲ့ ခွဲပါ။ h2 ကနေ h4 ကို ခုန်မသွားပါနဲ့။ header၊ nav၊ main၊ footer landmark တွေက screen reader user တွေကို page အပိုင်းတွေကြား တန်းခုန်သွားခွင့် ပေးပါတယ်။

၃။ Content

အဓိပ္ပာယ်ရှိတဲ့ ပုံတိုင်းမှာ ပုံထဲကအကြောင်းကို ပြောပြတဲ့ alt ရှိရပြီး အလှဆင်ပုံတွေမှာ alt="" ထားပါ။ Link စာသားက ဘယ်ကို သွားမလဲ ပြောရပါမယ်။ Link တိုင်းကို တကယ်နှိပ်ပြီး 404 မဖြစ်ကြောင်း စစ်ပါ။

၄။ Forms

Control တိုင်းမှာ ချိတ်ထားတဲ့ label၊ name နဲ့ မှန်ကန်တဲ့ type ရှိရပါမယ်။ Form ကို အလွတ်ပို့ကြည့်၊ မှားတဲ့ data ပို့ကြည့်ပြီး error message တွေ ပေါ်မပေါ် ကြည့်ပါ။

၅။ Small screens နဲ့ keyboard

Browser ကို 320px အထိ ကျုံ့ကြည့်ပြီး ဘေးတိုက် scroll မဖြစ်ရပါဘူး။ 200% zoom မှာလည်း စာတွေ ထပ်မနေရပါဘူး။ နောက်ဆုံး mouse ကို ဘေးချပြီး Tab key တစ်ခုတည်းနဲ့ link နဲ့ button အားလုံးကို ရောက်ပြီး focus ring ကို မြင်ရမရ စစ်ပါ။

Toolဖမ်းနိုင်တာမဖမ်းနိုင်တာ
W3C Nu validatorDoctype မပါ၊ alt မပါ၊ id ထပ်alt="image" လို အဓိပ္ပာယ်မဲ့ alt
Lighthouse / axeLabel မပါ၊ contrast နိမ့်Heading စာသား အဓိပ္ပာယ်
Keyboard + zoomFocus ပျောက်၊ စာထပ်Markup error တွေ
Mental model: အုတ်မြစ်ကနေ ခေါင်မိုးအထိ
  1. Document head ပြည့်စုံလား
  2. Heading နဲ့ landmark မှန်လား
  3. ပုံ၊ link၊ form နားလည်လွယ်လား
  4. Phone၊ zoom၊ keyboard နဲ့ သုံးရလား

အမှားတစ်ခု တွေ့ရင် ဘယ်လို ပြန်ဖြစ်အောင် လုပ်ရလဲ၊ ဘယ်လောက် ပြင်းထန်လဲ၊ ပြင်ပြီး ဘယ်လို ပြန်စစ်ခဲ့လဲ ဆိုတာကို မှတ်ထားပါ။

အခြေခံ ပုံစံ

html
<!DOCTYPE html>
<html lang="language-code">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Page topic | Site name</title>
  <meta name="description" content="One-sentence summary of this page">
</head>
<body>
  <!-- header, nav, main with exactly one h1, footer -->
</body>
</html>

Document အလွှာ checklist ကို code ပုံစံနဲ့ ပြထားတာပါ။ lang ကို page ရဲ့ ဘာသာစကား (en၊ my စသဖြင့်) နဲ့ အစားထိုးပါ။ Description က search result မှာ ပေါ်လာနိုင်တဲ့ အကျဉ်းချုပ်ပါ။

Starter template: checklist အလွှာ ၁ နဲ့ ၂ ကို အောင်တဲ့ shell

Project အသစ်တိုင်းကို ဗလာ file ကနေ မစဘဲ ဒီ template ကနေ စပါ။ Document အလွှာ (doctype၊ lang၊ charset၊ viewport၊ title) ပြည့်စုံပြီး header နဲ့ main landmark၊ h1 တစ်ခုလည်း ပါပြီးသားမို့ checklist ရဲ့ အောက်ခံ အလွှာနှစ်ခုကို စကတည်းက အောင်ပြီးသား ဖြစ်ပါတယ်။

html
<!-- A clean starter template -->
<!DOCTYPE html>
<html lang="my">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>My Clean HTML Page</title>
</head>
<body>
  <header>
    <h1>My Website</h1>
  </header>
  <main>
    <p>Start building from here.</p>
  </main>
</body>
</html>

Code ကို တစ်ပိုင်းချင်း ရှင်းပြမယ်

  1. Comment before the doctype<!-- A clean starter template -->

    HTML spec က doctype အရှေ့မှာ comment တွေကို ခွင့်ပြုပါတယ်၊ ခေတ်မီ browser တွေမှာ quirks mode မဖြစ်စေပါဘူး။ ဒါပေမယ့် doctype ကို file ရဲ့ ပထမဆုံး စာကြောင်းမှာ ထားတာက ပိုရိုးရှင်းပြီး ပိုလုံခြုံပါတယ်။

  2. Standards mode<!DOCTYPE html>

    ဒီ စာကြောင်း မပါရင် document.compatMode က "BackCompat" (quirks mode) ဖြစ်ပြီး box size တွေ၊ table layout တွေ ခေတ်ဟောင်း browser ပုံစံနဲ့ တွက်ပါတယ်။ ပါရင် "CSS1Compat" ဖြစ်ပါတယ်။

  3. Language<html lang="en">

    Screen reader က အသံထွက်ဖို့ ဘယ်ဘာသာ သုံးမလဲ၊ browser က translate လုပ်ဖို့ ကမ်းလှမ်းမလား ဆိုတာ ဒီ value ကို ကြည့်ပါတယ်။ Myanmar page ဆိုရင် lang="my" လို့ ပြောင်းပါ။

  4. Phone-friendly width<meta name="viewport" content="width=device-width, initial-scale=1.0">

    ဒီ tag မပါရင် phone browser တွေက page ကို 980px လောက် desktop width နဲ့ ဆွဲပြီး ချုံ့ပြလို့ စာလုံးတွေ သေးသွားပါတယ်။ Device ရဲ့ တကယ့် width ကို သုံးဖို့ ပြောတာပါ။

  5. One h1 inside a landmark<h1>My Website</h1>

    Template မှာ h1 က header ထဲမှာ ရှိပါတယ်။ တကယ့် page တွေမှာတော့ h1 ကို page တစ်ခုချင်းရဲ့ ခေါင်းစဉ် (ဥပမာ "Our breads") ဖြစ်အောင် main ထဲ ရွှေ့ပြီး site နာမည်ကို ရိုးရိုး link ဒါမှမဟုတ် logo အဖြစ် ထားလေ့ရှိပါတယ်။

You should see
အဖြူရောင် page ပေါ်မှာ "My Website" ဆိုတဲ့ ခေါင်းစဉ်ကြီးကို bold နဲ့ ပြပြီး အောက်မှာ "Start building from here." ဆိုတဲ့ paragraph ပေါ်ပါတယ်။ Browser tab မှာ "My Clean HTML Page" လို့ ပြပြီး page က standards mode နဲ့ render ဖြစ်ပါတယ်။

Issue report ကို ဘယ်လို ရေးမလဲ

Checklist က ပြဿနာ ရှာပေးရုံပါ၊ ပြင်ဖို့ကတော့ တခြားသူ (ဒါမှမဟုတ် နောက်တစ်ပတ်က ကိုယ်) နားလည်အောင် မှတ်ထားရပါမယ်။ "Form မကောင်းဘူး" လို့ ရေးရင် ဘယ်သူမှ ပြင်လို့မရပါဘူး။ ကောင်းတဲ့ report မှာ ဘယ်နေရာ၊ ဘယ်လို ပြန်ဖြစ်အောင် လုပ်ရလဲ၊ ဘာကို မျှော်လင့်ခဲ့လဲ၊ ဘယ်လောက် ပြင်းထန်လဲ ဆိုတာ ပါပါတယ်။

text
Page:      /index.html (bakery home)
Layer:     4. Forms
Steps:     Tab to the email box, turn on a screen reader
Expected:  "Email for news, edit text"
Actual:    "edit text" (no label; placeholder only)
Severity:  High - blind visitors cannot tell what the field is for
Fix check: label for="news-email" added; re-tested with the screen reader

လက်တွေ့ project တွေမှာ

လက်တွေ့ project တွေမှာ

Team တွေက ဒီ checklist ကို pull request template ထဲ ထည့်ထားပြီး reviewer က item တစ်ခုချင်းကို tick ပေးမှ merge လုပ်ပါတယ်။ Automated အပိုင်းကို CI ထဲ ထည့်ပါတယ်။ ဥပမာ HTML validator၊ Lighthouse နဲ့ broken-link checker တွေကို commit တိုင်းမှာ run ပြီး score ကျသွားရင် build ကို fail ဖြစ်စေပါတယ်။

ဒါပေမယ့် tool တွေက accessibility ပြဿနာ တစ်စိတ်တစ်ပိုင်းကိုပဲ ဖမ်းနိုင်ပါတယ်။ alt="photo" က validator ကို ကျော်နိုင်ပေမယ့် မျက်စိမမြင်တဲ့ user အတွက် ဘာအကူအညီမှ မပေးပါဘူး။ ဒါကြောင့် release မလုပ်ခင် တစ်ယောက်ယောက်က phone အစစ်ပေါ်မှာ page ကို ဖွင့်ကြည့်၊ keyboard နဲ့ သုံးကြည့်၊ screen reader နဲ့ နားထောင်ကြည့်တဲ့ manual pass ကို လုပ်ကြပါတယ်။ Social media မှာ share လုပ်တဲ့ page တွေအတွက် link preview (title၊ description၊ image) ကိုလည်း စစ်ပါတယ်။

အမှားများ

ဖြစ်လေ့ရှိတဲ့ အမှားများ

Validator စိမ်းရင် ပြီးပြီလို့ ယူဆတာ

Validator က syntax နဲ့ မပါမဖြစ် attribute တွေကိုပဲ စစ်ပါတယ်။ alt="img_0042"၊ "Read more" လို့ပဲ ရေးထားတဲ့ link ဆယ်ခု၊ h1 ထဲမှာ logo ပုံ သက်သက် စတာတွေက validator ကို ကျော်သွားပါတယ်။ Tool ရလဒ်ကို အစပဲ သဘောထားပြီး content ကို လူကိုယ်တိုင် ဖတ်စစ်ပါ။

Desktop mouse နဲ့ပဲ စမ်းတာ

Developer အများစုက ကြီးမားတဲ့ monitor ပေါ်မှာ mouse နဲ့ပဲ စမ်းကြပါတယ်။ Visitor အများစုကတော့ phone ပေါ်မှာ ဖြစ်ပြီး တချို့က keyboard တစ်ခုတည်းနဲ့ သုံးပါတယ်။ ဘေးတိုက် scroll၊ ပျောက်နေတဲ့ focus ring၊ div နဲ့ လုပ်ထားလို့ Enter နှိပ်မရတဲ့ button တွေကို 320px နဲ့ Tab test ကပဲ ဖော်ပြပါတယ်။

Heading ကို စာလုံးအရွယ်အစားနဲ့ ရွေးတာ

"h4 က သေးလို့ လှတယ်" ဆိုပြီး h1 အောက်မှာ h4 ကို သုံးလိုက်တာက outline ကို ကျိုးစေပါတယ်။ Heading level က အရေးပါမှု အဆင့်ကို ပြောတာပါ၊ အရွယ်အစားကို CSS နဲ့ ပြောင်းပါ။

Best Practices

Checklist ကို အကျိုးရှိအောင် သုံးနည်း

  • Project ပြီးခါနီးမှ တစ်ခါတည်း မစစ်ပါနဲ့။ Page အသစ်တစ်ခု ထည့်တိုင်း အလွှာ ၁ နဲ့ ၂ ကို ချက်ချင်း စစ်ပါ
  • Checklist ကို project folder ထဲမှာ text file အဖြစ် သိမ်းပြီး team တစ်ခုလုံး တူတူ သုံးပါ
  • အမှားတစ်မျိုးတည်း နှစ်ခါ တွေ့ရင် အဲဒါကို တားပေးမယ့် item အသစ်ကို checklist ထဲ ထည့်ပါ
  • Starter template ကို အမြဲ update လုပ်ထားပြီး project အသစ်တိုင်း အဲဒီကနေ စပါ

Mini challenge

Bakery page ကို checklist နဲ့ ပြင်ပါ

Problem section က bakery page ကို checklist အလွှာ ငါးခုနဲ့ စစ်ပြီး အမှားအားလုံးကို ပြင်ထားတဲ့ version ကို ရေးပါ။ Content (bakery နာမည်၊ ဖွင့်ချိန်၊ menu link၊ newsletter) ကိုတော့ မပြောင်းပါနဲ့။

  • Doctype၊ lang၊ charset၊ viewport နဲ့ ဖော်ပြချက်ပါတဲ့ title ထည့်ပါ
  • header၊ main၊ footer ထည့်ပြီး h1 တစ်ခု၊ ကျန်တာ h2 ဖြစ်ပါစေ
  • ပုံမှာ alt ထည့်ပြီး link စာသားက ဘယ်ကိုသွားမလဲ ပြောပါစေ
  • Newsletter ကို label၊ name၊ required၊ action နဲ့ method ပါတဲ့ form အဖြစ် ပြင်ပါ
bakery-after.html
<!DOCTYPE html>
<!-- TODO: lang on <html> -->
<html>
<head>
  <!-- TODO: charset, viewport, a title naming the bakery -->
</head>
<body>
  <!-- TODO: header landmark with the bakery name (not a bold div) -->
  <!-- TODO: main: exactly one h1, then h2 sections (no jump to h4) -->
  <!-- TODO: img with alt describing the bread, plus width/height -->
  <!-- TODO: link text that names the destination (no "Click here") -->
  <!-- TODO: newsletter form: label, name, type="email", required -->
  <!-- TODO: footer -->
</body>
</html>

ရလဒ်: Page က standards mode နဲ့ render ဖြစ်ပြီး h1 တစ်ခုတည်း၊ h2 နှစ်ခု ရှိပါတယ်။ ပုံမှာ alt ရှိပြီး email field ကို label နဲ့ ချိတ်ထားပါတယ်။ Email အလွတ်နဲ့ Join နှိပ်ရင် browser က တားပါတယ်။

အရိပ်အမြွက် ကြည့်ရန်

Bakery နာမည်က site တစ်ခုလုံးရဲ့ နာမည်ဖြစ်လို့ header ထဲမှာ ရိုးရိုး paragraph ဒါမှမဟုတ် link အဖြစ် ထားပြီး "Fresh bread every morning" ကို h1 လုပ်လို့ ရပါတယ်။ "Our breads" နဲ့ "Opening hours" က h2 ဖြစ်ပါမယ်။

အဖြေ ကြည့်ရန်
bakery-after.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Golden Crust Bakery | Fresh bread every morning</title>
  <meta name="description" content="Sourdough and fresh loaves, baked daily.">
</head>
<body>
  <header>
    <p><a href="/">Golden Crust Bakery</a></p>
  </header>
  <main>
    <h1>Fresh bread every morning</h1>

    <h2>Our breads</h2>
    <img src="sourdough.jpg" width="600" height="400"
         alt="Round sourdough loaf with a dark, crackled crust">
    <p><a href="/menu.html">See the full bread menu and prices</a></p>

    <h2>Opening hours</h2>
    <p>Monday to Saturday, 7am to 6pm.</p>

    <form action="/newsletter" method="post">
      <label for="news-email">Email for bakery news</label>
      <input id="news-email" name="email" type="email" autocomplete="email" required>
      <button type="submit">Join</button>
    </form>
  </main>
  <footer>
    <p>Golden Crust Bakery, 12 Market Street</p>
  </footer>
</body>
</html>

Quick Quiz 1 / 3

<!DOCTYPE html> ကို ဖျက်လိုက်ရင် document.compatMode က ဘာပြန်ပေးမလဲ။

Quick Quiz 2 / 3

အောက်ကထဲက ဘယ်ပြဿနာကို W3C validator က မဖမ်းနိုင်ပါသလဲ။

Quick Quiz 3 / 3

Section နှစ်ခုကြားမှာ အလှဆင်ဖို့ပဲ ထည့်ထားတဲ့ ပန်းပွင့် divider ပုံအတွက် ဘယ် alt က အမှန်ဆုံးလဲ။

မှတ်ထားရမယ့် အချက်များ

  • Document၊ structure၊ content၊ forms၊ small screens ဆိုတဲ့ အလွှာ ငါးခုကို အောက်ကနေ အပေါ်ကို စစ်ပါ
  • Doctype မပါရင် quirks mode ဖြစ်လို့ တခြား layout test တွေ ယုံလို့ မရပါဘူး
  • Validator က syntax ကို စစ်ပေမယ့် alt နဲ့ link စာသားရဲ့ အဓိပ္ပာယ်ကို လူကပဲ စစ်နိုင်ပါတယ်
  • 320px၊ 200% zoom နဲ့ Tab key test ကို release တိုင်းမှာ လုပ်ပါ
  • အမှားတိုင်းကို reproduce steps၊ severity နဲ့ fix check ပါအောင် မှတ်တမ်းတင်ပါ

HTML Living Standard — WHATWG

နောက်ဆုံးပြင်ဆင်ရက်

Progress ကို ဤ browser (ဤစက်) တွင်သာ သိမ်းထားပါသည်။ အခြားစက်များနှင့် sync မလုပ်ပါ။

ဤသင်ခန်းစာတွင် အမှားတွေ့ပါက အကြောင်းကြားရန်သင့် email app ကို ဤသင်ခန်းစာလိပ်စာ ဖြည့်ပြီးသားဖြင့် ဖွင့်ပေးပါမည် — သင်ကိုယ်တိုင် ပို့မှသာ ပို့မည်ဖြစ်သည်။

Final Checklist | Thuta Learning