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 fit all the fixed width 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:# as the boxes will just keep shrinking and not wrap..
 * NOTICE that this attributes only 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

<p style="font-size:1.3vw">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

<div style="width:12.5vw; height:30px; padding-top:3px; padding-left:1vw; background-color:orange; color:white; border:1px solid orange; border-radius:5px; ">Check your answers

<< Previous Chapter Next Chapter >>