HTML Tutorial · Chapter 6 of 9
HTML Images
Show pictures with meaningful alt text.
img needs src and should include alt for accessibility.
In classroom projects, keep image files in the same folder when possible.
Image sample
Try it Yourself »
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Images</title>
</head>
<body>
<h1>Portfolio</h1>
<img src="sample.svg" alt="Student portfolio badge" width="160">
<p>Images make pages clearer when alt text is useful.</p>
</body>
</html>
Classroom Tips
- Never leave alt empty for meaningful images.
- Use width carefully; CSS is better for responsive sizing.