CSS Grid Flashcards

1
Q

How to make any element into a css grid?

A

display: grid;

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

grid-template-columns:

A

a property that indicates the number of columns in the grid, and the value of each parameter indicates the width of each column.

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

grid-template-rows:

A

used to adjust the amount and width of rows

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

CSS Grid units:

A

fr: sets the column or row to a fraction of the available space.
auto: sets the column or row to the width or height of its content automatically

%: adjusts the column or row to the percent width of its container

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

grid-column-gap:

A

Used to add gaps between columns.

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

grid-row-gap:

A

Used to add gaps in between rows.

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

grid-gap

A

Short hand for grid-row/column-gap. If grid-gap has one value it will create a gap between all rows and columns; if there are two values, it will use the first one to set gaps for the rows and the second for columns.

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

grid-column:

A

a property used to control the amount of columns an item will consume.

(ex: grid column: 1 / 3;
this will make the item start at the first vertical line on the lift and span to the third, consuming two columns.)

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

grid-row:

A

a property used to control the amount of rows an item will consume.

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

justify-self:

A

A property used to align the content’s position within a cell, horizontally.

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

justify-self: start;

A

aligns the content at the left of the cell.

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

justify-self: stretch;

A

will make the content fill the whole width of the cell.

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

justify-self: center;

A

aligns the content in the center of the cell.

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

justify-self: end;

A

aligns the content at the right of the cell.

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

Cell

A

The content of each item is located in a box known as the grid.

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

align-self;

A

A property used to align the content’s position within a cell, vertically. It accepts all the same values as justify-self.

17
Q

justify-items:

A

A property used to align ALL items at once horizontally. Accepts all the values that justify-self and align-self do.

18
Q

align-items:

A

Similar to justify-items, it will align all items but do so vertically.

19
Q

grid-template-areas:

A

A property that is used to group cells of your grid together into an area and give the area a custom name.
Example:
grid-template-areas:
“header header header”
“advert content content”
“footer footer footer”;
Every word in the code represents a cell and every pair of quotation marks represent a row.
You can use a period to designate and empty cell in the grid.

20
Q

grid-area:

A

After creating an area’s template you can place an item in your custom area by referencing the name you gave it.
Example: .item1 { grid-area: header }

21
Q

Use grid-area w/o creating an areas template.

A

If your grid doesn’t have an area template to reference you can create on on the fly, like this:
item1 { grid-area: 1/1/2/4 }

These numbers represent:
grid-area: horizontal line to start at / vertical line to start at / horizontal line to start / vertical line to start at;

22
Q

grid-template-row/columns: repeat;

A

A function that is used to create several row/columns of the same size.

Example: grid-template-rows: repeat(100, 50px); this example would create 100 rows that are 50 px tall.

23
Q

minmax

A

Function used for grid-template-row/columns. It’s used to limit the size of items when the grid container changes size

ex: grid-template-columns: 100px minx(50px, 200px);

In this example grid-template-columns is set to create two columns; the first is 100px wide, and the second has the minimum width of 50px and the maximum width of 200px.

24
Q

repeat(auto-fill)

A

autofill is an option for repeat that allows you to automatically insert as many rows or columns of your desired size as possible depending on the size of your container.

example:
repeat(auto-fill, minimal(60px, 1fr));

25
Q

auto-fit

A

almost identical to auto-fill except that when the container’s size exceeds the size of all items combined, auto-fill keeps inserting empty rows or columns and pushes your items to the side, while auto-fit collapses those empty rows or columns and stretches your items to fit the size of the container..