Categories: Web Development

Creating a Stunning Image Gallery Using CSS Grid

Introduction to CSS Grid

The CSS Grid Layout is a powerful tool for creating responsive and visually appealing web layouts. Whether you are a web developer working on a new project or a hobbyist looking to enhance your portfolio, learning how to create an image gallery using CSS Grid will elevate your design skills.

HTML

Index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
   
    <link rel="stylesheet" href="index.css">

</head>
<body>

        <div class="container">
            <div class="item">
                <img src="https://picsum.photos/400/400?random=1" alt="">
            </div>
            <div class="item ">
                <img src="https://picsum.photos/400/400?random=2" alt="">

            </div>
            <div class="item ">
                <img src="https://picsum.photos/400/400?random=3" alt="">
            </div>
            <div class="item">
                <img src="https://picsum.photos/400/400?random=4" alt="">
            </div>
            <div class="item ">
                <img src="https://picsum.photos/400/400?random=5" alt="">
            </div>
            <div class="item">
                <img src="https://picsum.photos/400/400?random=6" alt="">
            </div>
            <div class="item">
                <img src="https://picsum.photos/400/400?random=7" alt="">
            </div>
        </div>
 
</body>
</html>

CSS

Index.css

.container
{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    grid-gap: 10px;
    

}


img {
    width: 100%;
    height: 400px;
    object-fit: cover;
  }
  
  .item2, .item3 {

    grid-column: span 2;

  }

I attached the video below How to make this System

 

admin

Share
Published by
admin

Recent Posts

Employee Working Hours Calculation System using C#.net

Initialize the employee number, Hourswork,and Hoursrate to calculate a grosswage use the following condition. if…

1 week ago

Java Payroll System Calculate Employee Overtime

Act as a Java developer to create a program that calculates the gross wage for…

1 week ago

Employee Working Hours Calculation System using Java

Initialize the employee number, Hourswork,and Hoursrate to calculate a grosswage use the following condition. if…

2 weeks ago

Laravel 11 School Management System

In this tutorial, we will teach you how to create a simple school management system…

2 weeks ago

How to Make Admin Panel Using React MUI

I have design the Admin Basic templete using React MUI Design Admin Dashboard and Login.Here…

4 weeks ago

Install Laravel Breeze for Authentication Using Laravel 11

In this tutorial ,i am to going teach the Laravel Breeze.Laravel Breeze provides a simple…

1 month ago