Section 10 - Grid Flashcards

1
Q

What is the CSS Grid system?

A

a 2D layout system

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

Flexbox is a great tool to align content in what way?

A

Helps align content along a 1D line (horizontal or vertical)

———>

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

Grid is a great tool to align content for what layouts?

A

Great for 2D layouts where you have a table structure with columns and rows

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

What does 2D mean?

A

That there is an X and a Y axis

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

If there’s an X and a Y axis, in most cases you’re better off using what?

A

(2D) Grid

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

You should only use either Flexbox or Grid. T or F?

A

False, most developers use both tools alongside others (floats, bootstraps, frameworks to create a design)

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

Within a Grid you can have a container laid out using Flexbox (3 horizontal divs within a Grid container). T or F?

A

True

(This is really common)

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

Having multiple divs in a Flexbox column (inside a grid container) is a really good way of setting the ______

A

alignment for each of the items

Web page: Weather
Grid Container: Degrees
Flexbox column: Weather Summary, Town, City, Feels Like, Postal Code

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

In terms of lining up items and gaps, which layout tends to match up with each other?

A

Grid

(Flexbox is hard to get the items to line up)

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

How do you create a Grid? (4 steps)

A
  1. Create a “parent” div container with a class (with elements inside, like paragraphs) in index.html
  2. Target the parent container class in styles.css, add display: grid
  3. Add grid-template-columns and grid-template-rows 1fr 2fr;
  4. Add a gap if needed for between columns and rows
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

With divs, for them to show up from invisible you need to set what 2 things?

A
  1. Background color
  2. Height/Width
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How many “fr” do you add to your grid-template-columns and rows line?

A

Depending on how many columns (or rows) you need. One “fr” for every column.

(stands for fraction)

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

What’s the default layout of the HTML flow?

A

The new item sits below the last item to create a column

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

All divs are set as display: block so they’re going to do what?

A

they’re going to try to occupy the full width of the screen by default

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

When a container tries to take up the full width of the screen, it can create ____

A

gaps between items

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

How do you fix a container that is trying to take up the full width of the screen? (default behavior for a div is display: block)

A

Set the width to a specific px to squish the items together

17
Q

What’s the default behavior for a grid container?

A

The default behavior for a grid container is to try and take up the full width, but only have as much height as it allows to fit the content

(so we don’t have to worry about/change the height)

18
Q

Default Flexbox behavior tries to do what with the content?

A

Tries to adapt and squish the content so that everything gets placed on the screen

19
Q

Default Grid behavior tries to do what with the content?

A

Creates a grid and lines everything up with each other on a column and row basis (gaps match up)

20
Q

How do you get rid of gaps between columns in a Grid layout?

A

Set a parent container width to squish all the columns together (since it’s trying to take up the full width of the web page)

21
Q
A