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.
Toggle checkboxes to add/remove attributes and see how the <img> element changes.
<img src="mountain.jpg" alt="Mountain at sunset" />
Image renders with alt visible on hover.
<a href="https://www.w3.org" target="_blank" rel="noopener"> Visit W3C </a>
rel="noopener" prevents security vulnerabilities.<a href="about.html"> About Page </a>
<!-- Target element: --> <h2 id="section-2">Section 2</h2> <!-- Link to it: --> <a href="#section-2">Go to Section 2</a>
id on the same page. Used in table of contents.<a href="mailto:info@example.com"> Email us </a> <a href="tel:+15551234567"> Call us </a>
mailto: and tel: are URL schemes.Click each link type to see what would happen (no actual navigation).
A semantic navigation bar uses <nav> + <ul> + <a>. Type pages below to build one live.
<nav> <a href="index.html">Home</a> <a href="lectures.html">Lectures</a> <a href="resources.html">Resources</a> </nav>
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>
The entire image is clickable. Always include alt text describing the link destination.