<!-- External link --> <a href="https://google.com">Go to Google</a> <!-- Open in new tab --> <a href="https://google.com" target="_blank">Open New Tab</a> <!-- Link to another page --> <a href="about.html">About Page</a> <!-- Link to section on same page (ID) --> <a href="#section1">Jump to Section 1</a> <h2 id="section1">Section 1</h2> <!-- Email link --> <a href="mailto:hello@example.com">Send Email</a> <!-- Phone link (mobile) --> <a href="tel:+959123456789">Call Us</a> <!-- Download link --> <a href="file.pdf" download>Download PDF</a>
Go to Google ← basic link
Open New Tab ← target="_blank"
Send Email ← mailto: link
+959-123-456-789 ← tel: link
| Attribute | Value | ဘာလုပ်တယ် |
|---|---|---|
href | URL or path | Link destination |
target | _blank | New tab မှာ ဖွင့် |
target | _self (default) | Same tab မှာ ဖွင့် |
download | boolean | File download ဖြစ်တယ် |
title | text | Hover tooltip |
<!-- Absolute path — full URL --> <a href="https://example.com/page.html">Absolute</a> <!-- Relative paths — ကိုယ့် file ကနေ တွက်ချင်း --> <a href="about.html">Same folder</a> <a href="pages/about.html">Subfolder</a> <a href="../index.html">Parent folder</a> <a href="/">Root / Home</a>
📁 my-website/
📄 index.html ← href="about.html"
📄 about.html
📁 pages/
📄 contact.html ← href="../index.html" (parent တက်)
📁 img/
🖼️ logo.png ← src="img/logo.png" (from pages/)
<!-- Basic image --> <img src="photo.jpg" alt="A beautiful photo"> <!-- With size --> <img src="logo.png" alt="Logo" width="200" height="100"> <!-- Responsive (CSS recommended) --> <img src="banner.jpg" alt="Banner" style="max-width:100%; height:auto"> <!-- External image URL --> <img src="https://via.placeholder.com/300x200" alt="Placeholder"> <!-- Lazy loading (performance) --> <img src="heavy.jpg" alt="Big image" loading="lazy">
width="120" height="80"
max-width:100%; height:auto
alt attribute မဖြစ်မနေ ထည့်ပါ! Screen reader + SEO အတွက် လိုတယ်| Attribute | ဘာလုပ်တယ် |
|---|---|
src | Image file path ၊ required |
alt | Image မတင်ရင် / screen reader text |
width | Pixel width |
height | Pixel height |
loading="lazy" | Scroll ရောက်မှ load (performance) |
title | Hover tooltip |
<!-- Image ကို click ရတဲ့ link ဖြစ်အောင် --> <a href="https://google.com" target="_blank"> <img src="logo.png" alt="Go to Google" width="150"> </a>
<a> tag ထဲမှာ <img> ထည့်တယ်
<figure>
<img src="cat.jpg"
alt="A cute cat"
width="300">
<figcaption>
ကြောင်လေး အိပ်နေတာ
</figcaption>
</figure>
<figure> + <figcaption> = semantic HTML — image နဲ့ caption ကို semantically link လုပ်တယ်| Format | Extension | သုံးရမည့်နေရာ |
|---|---|---|
| JPEG/JPG | .jpg .jpeg | Photos, real-world images |
| PNG | .png | Transparent background, logos |
| SVG | .svg | Icons, logos (vector, any size) |
| WebP | .webp | Modern web — small size, quality |
| GIF | .gif | Simple animations |
← HTML 02 | Next: HTML Lesson 04 → Tables