Help:Wiki University Flexbox - Flex Wrapping

<< Previous Chapter Next Chapter >>

Flex wrapping - flex-wrap:wrap

Here is one of the real beauties of Flexbox, the ability to "wrap" when there is not enough horizontal space to fix all the items in a row in a container. Here is a Flexbox element to do that: flex-wrap:wrap

To see the effect, drag the right edge of this page to the left.

Main Page Research Help Wiki Help Get Involved You will see the boxes begin to stack under each other as the width decreases. Here is the coding:  Main Page Research Help Wiki Help Get Involved


 * NOTICE that this attribute does not work with flex:#. The boxes will just keep shrinking and not wrap.  So this attributes works on with set widths.

This is a very important element! As more and more patrons view the Wiki on devises such as "smart phones or "tablets," it is necessary that our pages will be able to adapt to their view ports. Always keep in mind how your coding will appear on smaller view ports.  This will be a much used attribute.

Try these out

 Exercises

1. Take these five items and set them to a width of 300 pixels and put in a wrap attribute. Item 1 Item 2 Item 3 Item 4 Item 5 2. Made "item 3" three times larger than the rest, set the width to 250 pixels and then wrap them.

Check your answers

 Quick Quiz

1. Wrapping will only happen when flex:# is in the of the code line. A. True B. False 2. When wrapping, the last item will come the first item? A. True B. False 3. When wrapping, the last item will end up on top of the first item? A. True B. False

Check your answers

<< Previous Chapter Next Chapter >>