4
4
Write a HTML program, in such a way that, rather than placing large images on a page, the
preferred technique is to use thumbnails by setting the height and width parameters to
something like to 100*100 pixels. Each thumbnail image is also a link to a full sized version of the
image. Create an image gallery using this technique
PROGRAM :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Image Gallery</title>
<style>
.gallery {
display: flex;
flex-wrap: wrap;
}
.gallery img {
margin: 10px;
border: 2px solid #ddd;
border-radius: 4px;
width: 100px;
height: 100px;
}
.gallery a {
text-decoration: none;
}
</style>
</head>
<body>
<h1>Image Gallery</h1>
<div class="gallery">
<a href="full-size1.jpg" target="_blank">
<img src="thumbnail1.jpg" alt="Image 1 Thumbnail">
</a>
<a href="full-size2.jpg" target="_blank">
<img src="thumbnail2.jpg" alt="Image 2 Thumbnail">
</a>
<a href="full-size3.jpg" target="_blank">
<img src="thumbnail3.jpg" alt="Image 3 Thumbnail">
</a>
<!-- Add more images as needed -->
</div>
</body>
</html>
OUTPUT:
Image Gallery