Grid Flashcards

1
Q

What is CSS Grid?

A

A layout method for two-dimensional content using rows and columns.

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

What does CSS Grid allow the browser to do?

A

Auto-place items into created cells.

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

What are grid lines in CSS Grid?

A

The horizontal and vertical lines that form the structure of the grid.

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

How are grid lines numbered?

A

Starting from 1, following the writing mode and script direction.

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

What are grid tracks?

A

The space between two adjacent grid lines.

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

What is a grid cell?

A

The smallest space in a grid, formed by the intersection of row and column tracks.

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

What is a grid area?

A

A larger section of the grid created by spanning multiple grid cells.

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

What is the gap in CSS Grid?

A

The space (alley) between tracks.

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

What is a grid container?

A

An HTML element with display: grid, which creates a new grid formatting context.

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

What is a grid item?

A

A direct child of the grid container.

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

What does auto do in track sizing?

A

Makes a track as big as its content.

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

What does the min-content keyword do?

A

Sets the track to the smallest possible size without overflow.

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

What does the max-content keyword do?

A

Sets the track width so that content stays on a single line (may cause overflow).

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

What does fit-content() do?

A

Similar to max-content, but wraps content once it reaches a specified size.

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

How do auto-sized tracks behave by default?

A

They stretch to fill the container.

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

What is the fr unit in CSS Grid?

A

A flexible unit that distributes available space proportionally among tracks.

17
Q

How do you define three equal columns using fr?

A

grid-template-columns: 1fr 1fr 1fr;

18
Q

What does the minmax() function do?

A

Sets both a minimum and maximum size for a track.

19
Q

What does minmax(0, 1fr) do?

A

Makes tracks share available space equally while allowing them to shrink to 0.

20
Q

What is the repeat() function used for?

A

Repeats a track listing in a more concise way.

21
Q

How do auto-fill and auto-fit differ?

A

auto-fill creates as many tracks as will fit, leaving empty tracks if necessary; auto-fit collapses empty tracks.

22
Q

How are items placed by default in CSS Grid?

A

One per cell in the order they appear in the source, filling rows first.

23
Q

How do you make items auto-place in columns instead of rows?

A

grid-auto-flow: column;

24
Q

How can an item span multiple tracks in auto-placement?

A

Using grid-column-end: span X; or grid-row-end: span X;

25
Q

What properties are used to place grid items by line number?

A

grid-column-start, grid-column-end, grid-row-start, grid-row-end

26
Q

What are the shorthand properties for placing items?

A

grid-column and grid-row

27
Q

How can you place an item from the first to the last column line?

A

grid-column: 1 / -1;

28
Q

What is an explicit grid?

A

A grid created using grid-template properties with predefined tracks.

29
Q

What is an implicit grid?

A

A grid where additional tracks are created automatically when items exceed the defined rows/columns.

30
Q

How do you size implicit tracks?

A

Using grid-auto-rows or grid-auto-columns.

31
Q

How do you define named grid lines?

A

By placing names inside square brackets in grid-template-columns or grid-template-rows.

32
Q

How can named grid lines simplify placement?

A

Items can be positioned using names instead of line numbers.

33
Q

What does justify- affect in CSS Grid?

A

The inline axis (horizontal alignment).

34
Q

What does align- affect in CSS Grid?

A

The block axis (vertical alignment).