Skip to content

🎐 A collection of simple layout using CSS3 Grid system

Notifications You must be signed in to change notification settings

TechLead-21/Grid-mini-projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

A quick CSS3 Grid Layout

1. Basic Grid Layout A very simple 12 column grid layout.

.basic-grid {
  display: grid;
  gap: 1rem;

  /* grid-template-columns: repeat(12, 1fr); */

  /* better sizing, but overflow */
  /* grid-template-columns: repeat(12, minmax(240px, 1fr)); */

  /* better sizing, and no overflows */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

Output :

Basic Grid


2. Photo Gallery Grid Layout

.photo-grid {
  display: grid;
  gap: 1rem;

  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: 240px;
}

Output :

Photo Gallery


3. Animated Grid Layout

.animated-grid {
  height: 85vh;

  display: grid;
  gap: 1rem;

  /* Explicit grid */
  grid-template-areas:
    "a b c d"
    "l 🌟 🌟 e"
    "k 🌟 🌟 f"
    "j i h g";

  grid-template-rows: repeat(4, 25%);
  grid-template-columns: 240px auto auto 240px;

  --stagger-delay: 100ms;
}

Output :

Animated Grid

About

🎐 A collection of simple layout using CSS3 Grid system

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published