HTML Links and Images
Hyperlinks
<a href="https://developer.mozilla.org">Visit MDN</a><br>
<a href="https://example.com" target="_blank" rel="noopener">Open in a new tab</a><br>
<a href="#section2">Jump to a section on this page</a><br>
<a href="mailto:info@example.com">Send an email</a>
| Attribute | Purpose |
|---|---|
| href | Destination URL |
| target="_blank" | Open in a new tab |
| rel="noopener" | Security for new tabs |
| download | Download the linked file instead of opening it |
Images
<img src="photo.jpg" alt="Students in the computer lab" width="300" height="200">
Always add an alt attribute: screen readers read it aloud, and browsers show it if the image fails to load.
<figure>
<img src="chart.png" alt="Sales chart for 2026">
<figcaption>Figure 1: Monthly sales</figcaption>
</figure>
Track your progress through the HTML course