<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Website Image Gallery</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
}
body {
background: #f5f6fa;
padding: 40px;
}
h1 {
text-align: center;
margin-bottom: 30px;
color: #333;
}
.gallery {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
}
.gallery-item {
overflow: hidden;
border-radius: 12px;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
cursor: pointer;
background: #fff;
}
.gallery-item img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.4s ease;
}
.gallery-item:hover img {
transform: scale(1.1);
}
/* Lightbox */
.lightbox {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.85);
justify-content: center;
align-items: center;
z-index: 999;
}
.lightbox img {
max-width: 90%;
max-height: 90%;
border-radius: 10px;
}
.lightbox:target {
display: flex;
}
.close {
position: absolute;
top: 30px;
right: 40px;
font-size: 32px;
color: #fff;
text-decoration: none;
font-weight: bold;
}
</style>
</head>
<body>
</html>