Lecture 6 Demo

HTML Images & Hyperlinks

[Classroom Tip] Interact with each section to explore how image attributes work, the four types of hyperlinks, and how to build an accessible navigation menu.

1) Image Attributes Explorer

Toggle checkboxes to add/remove attributes and see how the <img> element changes.

Attribute Toggles:
Generated HTML:
<img src="mountain.jpg" alt="Mountain at sunset" />
Browser Preview:
🏔️ alt: Mountain at sunset

Image renders with alt visible on hover.

2) The Four Hyperlink Types

3) Link Simulator

Click each link type to see what would happen (no actual navigation).

🌐 External Link 📄 Internal Link ⚓ Anchor Link ✉️ Email Link 📞 Tel Link

4) Building a <nav> Menu

A semantic navigation bar uses <nav> + <ul> + <a>. Type pages below to build one live.

Visual Result:
Generated HTML:

5) Image as a Hyperlink

Wrapping an <img> inside an <a> makes the image clickable.

<a href="https://www.w3.org" target="_blank">
  <img src="w3c-logo.png"
       alt="Visit W3C website"
       width="120" />
</a>
Result (simulated):
W3C
alt: Visit W3C website

The entire image is clickable. Always include alt text describing the link destination.