Code Fellows 201
Day 08 Notes
Home
Reading
Learn CSS - Flexbox
Flexbox is designed for one-dimensional content. Explain what this means.
- one dimensional means only left, right, up, and down on the screen. No forward and backward (layers)
Explain the difference between the main axis and cross axis.
- The key to understanding flexbox is to understand the concept of a main axis and a cross axis. The main axis is the one set by your flex-direction property. If that is row your main axis is along the row, if it is column your main axis is along the column.
- Flex items move as a group on the main axis. Remember: we’ve got a bunch of things and we are trying to get the best layout for them as a group.
- The cross axis runs in the other direction to the main axis, so if flex-direction is row the cross axis runs along the column.
- You can do two things on the cross axis. You can move the items individually or as a group so they align against each other and the flex container. Also, if you have wrapped flex lines, you can treat those lines as a group in order to control how space is assigned to those lines. You will see how this all works in practice throughout this guide, for now just keep in mind that the main axis follows your flex-direction.
How can using certain properties of flexbox negatively impact accessibility?
- You should be cautious when using any properties that reorder the visual display away from how things are ordered in the HTML document, as it can negatively impact accessibility. The row-reverse and column-reverse values are a good example of this. The reordering only happens for the visual order, not the logical order. This is important to understand as the logical order is the order that a screen reader will read out the content, and anyone navigating using the keyboard will follow.
### CSS Layout - Flexbox
Read up to “Flex-Flow Shorthand”
What are some advantages of using flexbox over float?
-
For a long time, the only reliable cross-browser compatible tools available for creating CSS layouts were features like floats and positioning. These work, but in some ways they’re also limiting and frustrating.
-
The following simple layout designs are either difficult or impossible to achieve with such tools in any kind of convenient, flexible way:
- Vertically centering a block of content inside its parent.
- Making all the children of a container take up an equal amount of the available width/height, regardless of how much width/height is available.
- Making all columns in a multiple-column layout adopt the same height even if they contain a different amount of content.
How does this topic connect with your long term goals?
- Well, anything that is designed to save time or be easier to use; will be beneficial to me
Bookmark and Review
Learn CSS - Layout