CSSGrid Reference PDF
CSSGrid Reference PDF
CSSGrid Reference PDF
<div class="site">
Grid Container
<header class="masthead">
</header>
<h1 class="page-title">
Element containing a grid, </h1>
defined by setting
<main class="main-content">
display: grid; </main>
<aside class="sidebar">
</aside>
<footer class="footer">
</footer>
<h1 class="page-title">
Element that is a direct </h1>
descendant of the grid
<main class="main-content">
container. </main>
<aside class="sidebar">
</aside>
<footer class="footer">
</footer>
2
Grid lines are referenced
by number, starting and 3
ending with the outer
borders of the grid. 4
6
Grid Line 1
1 2 3 4 5 6
2
Grid lines can also be
named for easier 3
reference.
4
6
Grid Cell
grid-template-columns:
2fr 1fr 1fr;
2fr 1fr 1fr
Draws grid lines. Takes list
of length values (em, px, 2 fractions 1 fraction each
auto
grid-template-rows: Fit content
grid-column: 2/4;
grid-row::2/3;; 2
3
Applied to grid items.
Places the item by
declaring start and end
lines.
4
span keyword
The span keyword is used to define
how many grid tracks an element
should span.
grid-template-areas
main header header