HTML = HyperText Markup Language
Web page ရဲ့ အကျင်းပြ (skeleton) ။ Browser ကို "ဒါ heading, ဒါ paragraph, ဒါ image" ဆိုပြီး ပြောတဲ့ ဘာသာစကား။
<!DOCTYPE html> <!-- HTML5 ဆိုပြောတာ --> <html lang="en"> <!-- Root element --> <head> <!-- Browser အတွက် info (ကြည့်မမြင်ရ) --> <meta charset="UTF-8"> <!-- မြန်မာ/ဆိုင်ရာ character support --> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>My Page</title> <!-- Tab မှာ မြင်ရတဲ့ title --> <link rel="stylesheet" href="style.css"> </head> <body> <!-- Page မှာ မြင်ရတဲ့ content --> <h1>Hello World!</h1> <p>My first web page.</p> </body> </html>
<tag> နဲ့ closing </tag> ရှိရမယ် (void elements မှ လွဲ)
| Tag | အဓိပ္ပာယ် | Example |
|---|---|---|
<!DOCTYPE html> | HTML5 version ကြေညာ | File ထိပ်ဆုံးမှာ ထားရမယ် |
<html> | Document root | lang="my" = မြန်မာ |
<head> | Page info (hidden) | title, meta, link, script |
<meta charset> | Character encoding | UTF-8 = မြန်မာ font support |
<meta viewport> | Mobile responsive | မပါရင် mobile မှာ ကောင်းမရဘူး |
<title> | Tab/bookmark title | Browser tab ထိပ်မှာ ပြ |
<body> | Visible content | User မြင်ရတဲ့ အရာအကုန် |
📦 Container Tags (pair)
<p>Content here</p> <h1>Title</h1> <div>Block</div> <a href="#">Link</a>
Opening + closing tag နှစ်ခုလိုတယ်
🔷 Void/Self-closing Tags
<img src="photo.jpg" alt="pic"> <input type="text"> <br> <hr> <meta charset="UTF-8">
Closing tag မလိုဘူး (content မပါ)
<img src="cat.jpg" alt="A cute cat" width="300">
↑ ↑ ↑
attribute attribute attribute
name="value" name="value" name="value"
<a href="https://google.com" target="_blank">Google</a>
<input type="text" placeholder="Enter name" required>
name="value" ပုံစံ သုံးရတယ်။
အောက်က code ကို copy ပြီး my_page.html ဆိုတဲ့ ဖိုင်မှာ save လုပ်ပြီး browser မှာ ဖွင့်ကြည့်ပါ:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>ကျွန်ုပ်ရဲ့ ပထမဆုံး Page</title> </head> <body> <h1>မင်္ဂလာပါ!</h1> <p>ဒါ ကျွန်ုပ်ရဲ့ ပထမဆုံး website ပါ။</p> <p>HTML ကို လေ့လာနေပါတယ်!</p> </body> </html>
<p>Hello → မှားတယ်<p>Hello</p><P>Hello</P> (works but bad practice)<p>Hello</p><a href=google.com><a href="google.com">👆 Red tag တွေပေါ် hover လုပ်ကြည့်ပါ
Next: HTML Lesson 02 → Text & Lists