Colleges Gallery
Preview
Edit
Download
Run
Download Options
HTML File
Download as .html file
CSS File
Download as .css file
JavaScript File
Download as .js file
Combined HTML
All code in one HTML file
Project ZIP
All files in a ZIP archive
Cancel
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Colleges Gallery</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"> </head> <body> <section class="gallery-section"> <h2>Colleges Gallery</h2> <p class="twhite"> Explore our college campuses and facilities. From classrooms to libraries, labs, and sports arenas, we provide a comprehensive environment for higher education. </p> <div class="container"> <div class="gallery-container"> <div class="gallery-card"> <img src="https://images.unsplash.com/photo-1562774053-701939374585?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NHx8Y29sbGVnZXxlbnwwfHwwfHx8MA%3D%3D" alt="Campus View"> <div class="gallery-info"> <h4>Campus View</h4> <p>Modern, spacious, and eco-friendly campus</p> </div> </div> <div class="gallery-card"> <img src="https://images.unsplash.com/photo-1523240795612-9a054b0db644?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8M3x8Y29sbGVnZXxlbnwwfHwwfHx8MA%3D%3D" alt="Library"> <div class="gallery-info"> <h4>Library</h4> <p>Extensive collection of books and digital resources</p> </div> </div> <div class="gallery-card"> <img src="https://images.unsplash.com/photo-1677594334053-afe4b41aa0a3?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8OXx8Y29sbGVnZXxlbnwwfHwwfHx8MA%3D%3D" alt="Science Labs"> <div class="gallery-info"> <h4>Science Labs</h4> <p>Advanced laboratories for hands-on learning</p> </div> </div> <div class="gallery-card"> <img src="https://plus.unsplash.com/premium_photo-1691962725044-d80a7145f7ee?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8MzF8fGNvbGxlZ2V8ZW58MHx8MHx8fDA%3D" alt="Sports Facilities"> <div class="gallery-info"> <h4>Sports Facilities</h4> <p>Promoting physical fitness and teamwork</p> </div> </div> <div class="gallery-card"> <img src="https://images.unsplash.com/photo-1501503069356-3c6b82a17d89?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8Mjl8fGNvbGxlZ2V8ZW58MHx8MHx8fDA%3D" alt="Auditorium"> <div class="gallery-info"> <h4>Auditorium</h4> <p>Modern halls for events, seminars, and cultural programs</p> </div> </div> <div class="gallery-card"> <img src="https://images.unsplash.com/photo-1523580846011-d3a5bc25702b?w=500&auto=format&fit=crop&q=60&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxzZWFyY2h8NDl8fGNvbGxlZ2V8ZW58MHx8MHx8fDA%3D" alt="Hostel & Accommodation"> <div class="gallery-info"> <h4>Hostel & Accommodation</h4> <p>Comfortable living spaces for students</p> </div> </div> </div> </div> </section> </body> </html>
CSS
body { font-family: 'Poppins', sans-serif; background: #f5f5f5; color: #333; } .gallery-section { padding: 90px 20px; text-align: center; background: #f5f5f5; } .gallery-section h2 { font-size: 2.8rem; font-weight: 700; color: #1a237e; margin-bottom: 15px; } .gallery-section p { font-size: 1.15rem; color: #ffffff; max-width: 750px; margin: 0 auto 50px; } .twhite { color: #1a237e !important; } .gallery-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; } .gallery-card { position: relative; overflow: hidden; border-radius: 16px; background: #fff; box-shadow: 0 8px 25px rgba(0,0,0,0.12); transition: transform 0.5s ease, box-shadow 0.5s ease; opacity: 0; transform: translateY(60px); } .gallery-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; } .gallery-card:hover img { transform: scale(1.1); } .gallery-card:hover { transform: translateY(-12px); box-shadow: 0 16px 35px rgba(0,0,0,0.25); } .gallery-info { position: absolute; bottom: 0; left: 0; width: 100%; background: linear-gradient(to top, rgba(26,35,126,0.85), rgba(26,35,126,0)); color: #fff; padding: 20px; text-align: left; } .gallery-info h4 { margin: 0; font-size: 1.25rem; font-weight: 600; } .gallery-info p { margin: 5px 0 0; opacity: 0.95; font-size: 0.95rem; }
JavaScript
// Scroll animation using IntersectionObserver const cards = document.querySelectorAll('.gallery-card'); const observer = new IntersectionObserver(entries => { entries.forEach(entry => { if(entry.isIntersecting){ entry.target.style.opacity = '1'; entry.target.style.transform = 'translateY(0)'; observer.unobserve(entry.target); } }); }, { threshold: 0.2 }); cards.forEach(card => observer.observe(card));
Output Preview
Desktop
Mobile
Fullscreen