Questions
17 of 51
1What is Flexbox in CSS?
2What problem does Flexbox solve compared to traditional layouts like float or inline-block?
3How do you create a flex container?
4What are the main and cross axes in Flexbox?
5What does the display: flex property do?
6What is the difference between display: flex and display: inline-flex?
7What are flex items?
8How do you change the direction of items in a flex container?
9What does flex-direction: row do?
10What does flex-direction: column do?
11What is the purpose of the justify-content property?
12What does the align-items property control?
13What are the possible values of align-content?
14What is the difference between align-items and align-content?
15What is the use of the flex-wrap property?
16How can you make flex items wrap onto multiple lines?
17What does the flex-flow shorthand property do?
18How does the order property affect flex items?
19How does the align-self property work?
20How do you vertically center content using Flexbox?
21What does the flex shorthand property represent?
22What are the three components of the flex shorthand property?
23What is the default value of the flex property?
24How do flex-grow, flex-shrink, and flex-basis work individually?
25What is the difference between flex: 1 and flex: auto?
26What is the difference between flex: 1 and flex: auto?
27What is the purpose of the gap property in Flexbox?
28How does Flexbox handle overflowing content?
29What’s the difference between justify-content: space-around and space-between?
30How does Flexbox handle fixed and flexible widths together?
31Can Flexbox be nested?
32How is Flexbox different from CSS Grid?
33When would you use Flexbox instead of Grid?
34Can you use Flexbox and Grid together in the same layout?
35How does Flexbox differ from traditional float-based layouts?
36Does Flexbox affect the box model or positioning of elements?
37How does Flexbox handle min-width and max-width constraints?
38How do flex items align when the container has align-items: stretch?
39What is the difference between flex: 0 1 auto and flex: 1 0 auto?
40How does flex-basis differ from width?
41How do you prevent a flex item from shrinking?
42How would you create a horizontal navigation bar using Flexbox?
43How do you center a div both horizontally and vertically using Flexbox?
44How can you make a responsive layout using Flexbox?
45How can you make one flex item take up the remaining space in a container?
46How do you create equal-height columns using Flexbox?
47How can you align the last flex item to the right side of the container?
48How can you reorder items visually using Flexbox without changing the HTML structure?
49How can you make items stack vertically on mobile and horizontally on desktop using Flexbox?
50How do you prevent an element from wrapping in a flex container?
51How can you align items to the bottom of a container using Flexbox?
17 / 51

What does the flex-flow shorthand property do?

Understanding the flex-flow Property in Flexbox

The flex-flow property in CSS is a shorthand for defining both the flex-direction and flex-wrap properties in one declaration. It allows you to control the direction of flex items and whether they should wrap onto multiple lines within a flex container.

Syntax
  1. 1

    flex-flow: <flex-direction> <flex-wrap>;

  2. 2

    Both values are optional, and if omitted, their defaults (row and nowrap) are used.

Possible Values
  1. 1

    flex-direction: Defines the direction of the main axis (row, row-reverse, column, column-reverse).

  2. 2

    flex-wrap: Determines whether flex items stay on one line or wrap (nowrap, wrap, wrap-reverse).

Example: Using flex-flow

In this example, flex-flow: row wrap sets the flex container to arrange items in a row and allows them to wrap onto multiple lines when necessary.

Best Practices
  1. 1

    Use flex-flow for concise and readable Flexbox declarations.

  2. 2

    Combine row wrap for horizontal layouts that adjust across screen sizes.

  3. 3

    Remember that the default value is flex-flow: row nowrap if unspecified.

Difficulty: 3/10
Topics: flex-direction, flex-wrap, shorthand composition

Scenario Questions

0-2 years experience
  1. 1

    You're building a mobile navigation bar that should stack vertically on small screens but stay horizontal on desktop. How would you use flex-flow to achieve that?

  2. 2

    If you set flex-flow: wrap row; on a container but the items still don't wrap, what's the most likely mistake?

  3. 3

    How would you write the shortest flex-flow rule to make items flow horizontally and never wrap?

2-5 years experience
  1. 1

    A team member changed flex-flow from row wrap to column wrap on a product grid, and now the layout breaks on tablets. How would you debug this?

  2. 2

    You're building a responsive card layout that needs to switch from row to column on medium screens. Why might you prefer flex-flow over media queries with separate flex-direction and flex-wrap declarations?

  3. 3

    A flex container with flex-flow: column nowrap is causing overflow on mobile. What are two ways to fix this without changing the HTML structure?

5-8 years experience
  1. 1

    You're designing a reusable layout component that must support both horizontal and vertical flows based on theme or user preference. How would you architect the CSS to make flex-flow dynamic and maintainable?

  2. 2

    In a high-traffic UI with hundreds of flex containers, how might using flex-flow vs. separate properties impact rendering performance or bundle size?

  3. 3

    A legacy component uses flex-direction: row and flex-wrap: wrap separately. You're refactoring for consistency. What risks do you assess before switching to flex-flow?

8+ years experience
  1. 1

    Your company is migrating from a legacy grid system to CSS Flexbox. How would you standardize flex-flow usage across 50+ teams to avoid layout fragmentation and technical debt?

  2. 2

    You're designing a design system for a global product with RTL and LTR locales. How does flex-flow interact with direction: rtl, and what edge cases must you document for global teams?

  3. 3

    A critical component uses flex-flow in a way that breaks under CSS containment. How would you evaluate whether to refactor it, and what long-term architectural tradeoffs do you weigh?

Follow-up Questions

  • What happens if you set flex-flow to row-reverse wrap?
  • How would you debug a layout where items aren't wrapping as expected despite using flex-flow?
  • Why might you choose to use flex-flow over setting flex-direction and flex-wrap separately?