CSS CSS Flexbox Layout Flexbox Properties Wrapping Items and Distributing Space

Nahom Micheal
Nahom Micheal
3,364 Points

multi-line flex container

how to create multi-line flex container? how to give .row the flexbox property a value that will make it a multi-line flex container?

/* Complete the challenge by writing CSS below */

<!DOCTYPE html>
  <title>Flexbox Layout</title>
  <link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="page.css">
  <link rel="stylesheet" href="style.css">
  <div class="row">
    <div class="item">Item 1</div>
    <div class="item">Item 2</div>
    <div class="item">Item 3</div>
    <div class="item">Item 4</div>
    <div class="item">Item 5</div>
    <div class="item">Item 6</div>

3 Answers

Michael Watson
Michael Watson
13,204 Points

Wouldn't a multi-line flex container use "column"? I thought this was a bug. "Wrap" is only multi-line if the viewing size changes, so on it's own it's a single line.

For that challenge it will not accept the flex-flow property. Only use

.row {
     display: flex;
     flex-wrap: wrap;

Nevertheless, that shorthand property is acceptable in application.

and remember the value wrap breaks the flex items into multiple lines