CSS Grid Layout is a two-dimensional layout system for the web, allowing you to design web pages using rows and columns. Itβs powerful and flexible, making it easy to create complex layouts.
.container { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; }
display: grid;
β enables grid layout on the containergrid-template-columns:
β defines the number and size of columnsgrid-template-rows:
β defines the number and size of rowsgrid-gap:
β sets the gap between rows and columnsgrid-column:
β defines the position of an item in the gridgrid-row:
β defines the position of an item in the grid verticallyUse grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
to create a responsive grid layout that adjusts the number of columns based on available space.
Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!