CSS Grid

 CSS Grid


CSS Grid is a layout system that allows you to create complex layouts without using floats or positioning. Here's an example of using CSS Grid to create a simple grid:



.container {

  display: grid;

  grid-template-columns: 1fr 1fr 1fr;

  grid-gap: 20px;

}


.item {

  background-color: #ccc;

  padding: 20px;

}

In this code, we're creating a grid container with three columns (grid-template-columns: 1fr 1fr 1fr) and a gap of 20 pixels between each item (grid-gap: 20px). Each item in the grid will have a gray background and 20 pixels of padding.

No comments:

Post a Comment

The Importance of Cybersecurity in the Digital Age

 The Importance of Cybersecurity in the Digital Age Introduction: In today's digital age, where technology is deeply intertwined with ev...