Подробнее в словаре терминов по фронтенду.
<div class="sample">
<div class="sample__item"></div>
<div class="sample__item"></div>
<div class="sample__item"></div>
<div class="sample__item"></div>
<div class="sample__item"></div>
</div>
.sample { /* Пока пусто */ }
.sample__item {
background: #0175A7;
}
.sample__item:first-child { background: #090 }
.sample__item:last-child { background: #C00 }
.sample__item::before { content: counter(list) }
.sample {
display: grid;
}
.sample {
grid-template-columns: 1fr 1fr;
}
.sample {
grid-template-columns: 1fr 1fr 1fr;
}
.sample {
grid-template-columns: 1fr 2fr 3fr;
}
.sample {
grid-template-columns: 250px 1fr 250px;
}
.sample {
grid-template-columns: 150px 1fr 150px;
grid-template-rows: 150px 1fr 150px;
}
.sample {
grid-template-columns: 1fr 1fr 1fr;
}
.sample :nth-child(1) {
grid-column: 1 / 4;
}
.sample :nth-child(5) {
grid-column: 1 / 4;
}
.sample :nth-child(1) {
grid-row: 3 / 4;
}
.sample :nth-child(5) {
grid-row: 1 / 2;
}
.sample :nth-child(1) {
grid-area: 3 / 1 / 4 / 4;
}
.sample :nth-child(5) {
grid-area: 1 / 1 / 2 / 4;
}
.sample {
grid-template-areas:
'a a a a'
'b c c d' /* Шаблон области */
'e e e e';
}
.sample :nth-child(1) { grid-area: a }
.sample :nth-child(2) { grid-area: b }
.sample :nth-child(3) { grid-area: c }
.sample :nth-child(4) { grid-area: d }
.sample :nth-child(5) { grid-area: e }
.sample :nth-child(1) { grid-area: b }
.sample :nth-child(2) { grid-area: a }
.sample :nth-child(3) { grid-area: e }
.sample :nth-child(4) { grid-area: c }
.sample :nth-child(5) { grid-area: d }
.sample {
grid-template-areas:
'a a a a'
'b c c d'
'e e e e';
}
.sample {
grid-template-areas:
'a a a a'
'b c c d'
'b c c d'
'e e e e';
}
.sample {
grid-template-areas:
'🐷 🐷 🐷 🐷'
'🐸 🐼 🐼 🐤'
'🐵 🐵 🐵 🐵';
}
display
grid-template-columns
grid-template-rows
grid-template-areas
grid-template
grid-column-gap
grid-row-gap
grid-gap
justify-items
align-items
justify-content
align-content
grid-auto-columns
grid-auto-rows
grid-auto-flow
grid
grid-column-start
grid-column-end
grid-row-start
grid-row-end
grid-column
grid-row
grid-area
justify-self
align-self