This example shows a simple webpage with an image and a caption. The image scales to fit the screen and has a description for accessibility.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Image Tag Example</title>
<style>
body {
font-family: Arial, sans-serif;
padding: 1rem;
max-width: 600px;
margin: auto;
}
img {
max-width: 100%;
height: auto;
border-radius: 0.5rem;
display: block;
margin-bottom: 1rem;
}
figcaption {
font-style: italic;
color: #555;
margin-bottom: 2rem;
}
</style>
</head>
<body>
<main>
<figure>
<img src="https://via.placeholder.com/400x200.png?text=Sample+Image" alt="Sample placeholder image">
<figcaption>This is a sample image with a description.</figcaption>
</figure>
<p>Images help make content clearer and more engaging.</p>
</main>
</body>
</html>