An <a> tag is like a signpost pointing down a trail - href is which trail it points to. An <img> tag is like a framed photo hung on the wall - src is which photo goes in the frame, alt is the little caption underneath it.
A link (<a href="...">) lets a visitor click through to another page. An image (<img src="..." alt="...">) shows a picture right on the page. Both need to point somewhere - href for a link's destination, src for an image's picture file.
<a href="https://example.com">Click here</a>
<img src="picture.jpg" alt="A description of the picture"><p>Check out my favorite site:</p>
<a href="https://www.nasa.gov">NASA</a>
<img src="rocket.jpg" alt="A rocket launching">The <a> tag's href points to the address the link goes to when clicked, and the text between <a> and </a> ("NASA") is what's actually clickable. The <img> tag's src points to the picture file, and alt describes the picture in words - read aloud by screen readers, and shown if the picture fails to load.
<p>My favorite game:</p>
<a href="https://www.minecraft.net">Minecraft</a>
<img src="dragon.jpg" alt="An ender dragon">Same two tags, a new destination and picture - href always points to where a link goes, and src always points to which picture an image shows.
In the app this lesson continues with the animated explanation, spoken aloud, and then the practice: Add a link (<a href="...">) with some visible text, right after the paragraph. The editor runs your child’s real code and checks the result, with their coding buddy reacting to what they wrote.
Try it free