CSS Flexbox and Grid

Description: Test your knowledge on CSS Flexbox and Grid with this comprehensive quiz. Assess your understanding of the fundamental concepts, properties, and techniques used in these powerful layout modules.
Number of Questions: 15
Created by:
Tags: css flexbox grid layout web development
Attempted 0/15 Correct 0 Score 0

What property is used to define the direction of flex items in a flex container?

  1. flex-direction

  2. flex-wrap

  3. justify-content

  4. align-items


Correct Option: A
Explanation:

The flex-direction property determines the direction in which flex items are laid out within the flex container. It can be set to row, column, row-reverse, or column-reverse.

What property is used to control the wrapping behavior of flex items when they reach the end of a flex container?

  1. flex-direction

  2. flex-wrap

  3. justify-content

  4. align-items


Correct Option: B
Explanation:

The flex-wrap property controls whether flex items should wrap to the next line or remain on the same line when they reach the end of the flex container. It can be set to nowrap, wrap, or wrap-reverse.

What property is used to distribute space between flex items along the main axis of the flex container?

  1. flex-direction

  2. flex-wrap

  3. justify-content

  4. align-items


Correct Option: C
Explanation:

The justify-content property distributes space between flex items along the main axis of the flex container. It can be set to flex-start, flex-end, center, space-between, or space-around.

What property is used to distribute space between flex items along the cross axis of the flex container?

  1. flex-direction

  2. flex-wrap

  3. justify-content

  4. align-items


Correct Option: D
Explanation:

The align-items property distributes space between flex items along the cross axis of the flex container. It can be set to flex-start, flex-end, center, baseline, or stretch.

What property is used to specify the initial size of flex items in a flex container?

  1. flex-grow

  2. flex-shrink

  3. flex-basis

  4. flex


Correct Option: C
Explanation:

The flex-basis property specifies the initial size of flex items in a flex container. It can be set to a specific length value, a percentage, or auto.

What property is used to control how flex items grow when there is extra space in the flex container?

  1. flex-grow

  2. flex-shrink

  3. flex-basis

  4. flex


Correct Option: A
Explanation:

The flex-grow property controls how flex items grow when there is extra space in the flex container. It can be set to a number, a percentage, or 0.

What property is used to control how flex items shrink when there is not enough space in the flex container?

  1. flex-grow

  2. flex-shrink

  3. flex-basis

  4. flex


Correct Option: B
Explanation:

The flex-shrink property controls how flex items shrink when there is not enough space in the flex container. It can be set to a number, a percentage, or 0.

What property is used to specify a shorthand for the flex-grow, flex-shrink, and flex-basis properties?

  1. flex-grow

  2. flex-shrink

  3. flex-basis

  4. flex


Correct Option: D
Explanation:

The flex property is a shorthand for the flex-grow, flex-shrink, and flex-basis properties. It can be set to a single value or a combination of values.

What is the default value of the flex-direction property?

  1. row

  2. column

  3. row-reverse

  4. column-reverse


Correct Option: A
Explanation:

The default value of the flex-direction property is row, which means that flex items are laid out horizontally.

What is the default value of the flex-wrap property?

  1. nowrap

  2. wrap

  3. wrap-reverse


Correct Option: A
Explanation:

The default value of the flex-wrap property is nowrap, which means that flex items will not wrap to the next line when they reach the end of the flex container.

What is the default value of the justify-content property?

  1. flex-start

  2. flex-end

  3. center

  4. space-between

  5. space-around


Correct Option: A
Explanation:

The default value of the justify-content property is flex-start, which means that flex items are aligned at the start of the flex container.

What is the default value of the align-items property?

  1. flex-start

  2. flex-end

  3. center

  4. baseline

  5. stretch


Correct Option: E
Explanation:

The default value of the align-items property is stretch, which means that flex items are stretched to fill the entire height of the flex container.

What is the default value of the flex-grow property?

  1. 0

  2. 1

  3. 2

  4. 3


Correct Option: A
Explanation:

The default value of the flex-grow property is 0, which means that flex items will not grow when there is extra space in the flex container.

What is the default value of the flex-shrink property?

  1. 0

  2. 1

  3. 2

  4. 3


Correct Option: B
Explanation:

The default value of the flex-shrink property is 1, which means that flex items will shrink proportionally when there is not enough space in the flex container.

What is the default value of the flex-basis property?

  1. 0

  2. auto

  3. 100%

  4. 200%


Correct Option: B
Explanation:

The default value of the flex-basis property is auto, which means that flex items will have their natural size.

- Hide questions