CSS Grid Flashcards

1
Q

Turn a div into a grid container

A

display: grid

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What property specifies column widths?

A

grid-template-columns: 100px 600px 300px

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How can you name a column?

A

grid-template-columns: [column-name] 1fr [column-name] 2fr … (Each side of a column can only have one name)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What property creates modules for “modular” layouts?

A

grid-template-area

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Use modular layout property to make title span top and a sidebar and main area below

A

grid-template-area:
“title title”
“sidebar main”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Create 3 rows with equal heights

A

grid-template-rows: 1fr 1fr 1fr

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What’s shorthand for having a column extend from column 1 to column 4?

A

grid-column: 1 / 4 (or use named columns) Also, grid-template-area might be a better way to handle this situation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Can you name grid-template-columns with multiple names?

A

No, but you can use names in multiple ways:
[a-start] 1f [b-start] 1fr [b-end] 1f [a-end];
.grid-item { grid-column: a/b; // on left
.grid-item { grid-column: c/c; // on right
.grid-item { grid-column: a; // full width

How well did you know this?
1
Not at all
2
3
4
5
Perfectly