Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is a flex container in CSS?
A flex container is an element with display: flex; or display: inline-flex;. It arranges its child elements (flex items) in a flexible way, either in a row or column.
Click to reveal answer
beginner
How do you make an element a flex container?
You set its CSS display property to flex or inline-flex. For example: display: flex;
Click to reveal answer
beginner
What is the default direction of flex items inside a flex container?
The default direction is a horizontal row from left to right, controlled by flex-direction: row;.
Click to reveal answer
beginner
Name two common values for the display property that create a flex container.
The two common values are flex and inline-flex. flex makes a block-level flex container, inline-flex makes an inline-level flex container.
Click to reveal answer
beginner
Why use a flex container instead of normal block layout?
A flex container helps arrange items easily in rows or columns, align them nicely, and distribute space evenly. It adapts well to different screen sizes, making layouts flexible and responsive.
Click to reveal answer
Which CSS property turns an element into a flex container?
Aposition: flex;
Bfloat: left;
Cflex-direction: row;
Ddisplay: flex;
✗ Incorrect
Only display: flex; or display: inline-flex; makes an element a flex container.
What is the default direction of flex items inside a flex container?
AColumn from top to bottom
BRow from left to right
CRow from right to left
DColumn from bottom to top
✗ Incorrect
The default flex-direction is row, which arranges items horizontally from left to right.
Which value of display creates an inline flex container?
Aflex-inline-block
Bflex-inline
Cinline-flex
Dinline-block-flex
✗ Incorrect
inline-flex creates a flex container that behaves like an inline element.
What does a flex container help you do?
AArrange child elements flexibly in rows or columns
BAdd colors to text
CMake text bold
DHide elements
✗ Incorrect
Flex containers arrange their child elements in flexible rows or columns for better layout control.
Which of these is NOT a property of a flex container?
Atext-decoration
Balign-items
Cflex-wrap
Djustify-content
✗ Incorrect
text-decoration styles text, not layout. The others control flex container behavior.
Explain what a flex container is and how you create one in CSS.
Think about the CSS property that changes layout behavior.
You got /3 concepts.
Describe the default layout direction of flex items inside a flex container and why it is useful.
Consider how items line up by default.
You got /3 concepts.
Practice
(1/5)
1. What does setting display: flex; on a container do?
easy
A. It hides the container and its children.
B. It makes the container's text bold.
C. It changes the container's background color.
D. It makes the container a flex container, arranging children in a row or column.
Solution
Step 1: Understand the role of display: flex;
Setting display: flex; on a container activates flexbox layout for its children.
Step 2: Effect on child elements
Children inside a flex container are arranged in a row by default or column if specified.
Final Answer:
It makes the container a flex container, arranging children in a row or column. -> Option D
Quick Check:
Flex container = display: flex [OK]
Hint: Remember: display: flex creates a flexible box container [OK]
Common Mistakes:
Confusing flex container with hiding elements
Thinking it changes colors or text styles
Assuming it only affects text formatting
2. Which of the following is the correct CSS syntax to make a container a flex container?
easy
A. container { display: flex; }
B. container { display: block-flex; }
C. container { flex: display; }
D. container { flex-display: true; }
Solution
Step 1: Identify correct CSS property and value
The correct property to enable flexbox is display with the value flex.