Answers for "grid css"

CSS
7

css grid repeat

repeat(/*Number of repeats*/, /*Code to be repeated*/)

.gridContainer {
	grid-template-columns: repeat(4, 100px); /*Creates 4 columns, each 100px in width*/
	grid-template-rows: repeat(2, 250px); /*Creates 2 rows, each 250px in height*/
}
Posted by: Guest on April-02-2020
1

css grid

.wrapper {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
  grid-auto-rows: 100px;
  grid-template-areas:
    "a a a a b b b b"
    "a a a a b b b b"
    "c c c c d d d d"
    "c c c c d d d d";
  align-items: start;
}
.item1 {
  grid-area: a;
}
.item2 {
  grid-area: b;
}
.item3 {
  grid-area: c;
}
.item4 {
  grid-area: d;
}
Copy to Clipboard
<div class="wrapper">
  <div class="item1">Item 1</div>
  <div class="item2">Item 2</div>
  <div class="item3">Item 3</div>
  <div class="item4">Item 4</div>
</div>
Copy to Clipboard
Posted by: Guest on August-11-2021
2

css grid

.container {
  grid-template-columns: 1fx 1fr 1fr;
  grid-template-rows: 80px auto 80px; 
  column-gap: 10px;
  row-gap: 15px;
}
Posted by: Guest on July-12-2021
4

grid in ccss

/*
Most Common Grid properties:

display: grid; 
display: inline-grid; for applying inline property on grid
grid-template-rows: 
grid-template-columns: 
grid-auto-flow: dense;
grid-column-start: 2;
grid-column-end: 4;
grid-row-start: 1;
grid-row-end: 3;
justify content
align items

fr = fill up any available space
auto-fit= stretch the cards to fill up the screen 
auto-fill= create extra virtual cards to fill up the screen
*/
.grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(auto, 1fr));
  grid-template-rows: repeat(2, 200px);
  grid-gap: 10px;
}
Posted by: Guest on May-29-2021
10

css grid

.item-a {
  grid-area: header;
}
.item-b {
  grid-area: main;
}
.item-c {
  grid-area: sidebar;
}
.item-d {
  grid-area: footer;
}

.container {
  display: grid;
  grid-template-columns: 50px 50px 50px 50px;
  grid-template-rows: auto;
  grid-template-areas: 
    "header header header header"
    "main main . sidebar"
    "footer footer footer footer";
}
Posted by: Guest on April-12-2020
2

grid css

.container {
  grid-template-columns: [first] 40px [line2] 50px [line3] auto [col4-start] 50px [five] 40px [end];
  grid-template-rows: [row1-start] 25% [row1-end] 100px [third-line] auto [last-line];
}
Posted by: Guest on December-03-2020

Browse Popular Code Answers by Language