reading-notes

Flexbox

Flex Container

The container is the parent element that contains a set of flex items. To create a flex container, set the display property of the parent element to flex or inline-flex.

Flex Items

Flex items are the child elements inside the flex container. They can be any HTML element, and each item can have its own unique properties. Flex items are arranged in a single line, called the “main axis”, and a perpendicular line, called the “cross axis”.

Flex Direction

The flex-direction property determines the direction of the main axis. It can be set to row (the default), row-reverse, column or column-reverse.

Justify Content

The justify-content property aligns items along the main axis. It can be set to flex-start (the default), flex-end, center, space-between, space-around, or space-evenly.

Align Items

The align-items property aligns items along the cross axis. It can be set to stretch (the default), flex-start, flex-end, center, baseline, or first baseline.

Align Content

The align-content property aligns the space between the flex lines. It can be set to stretch (the default), flex-start, flex-end, center, space-between, space-around, or space-evenly.

Flex Grow, Shrink, and Basis

The flex-grow, flex-shrink, and flex-basis properties are used to set the size of the flex items. Flex-grow determines how much the item grows relative to the other items, flex-shrink determines how much the item shrinks relative to the other items, and flex-basis sets the initial size of the item.

Flex Wrap

The flex-wrap property determines whether the flex items are forced onto a single line or can wrap onto multiple lines. It can be set to nowrap (the default), wrap, or wrap-reverse.

Flex Flow

The flex-flow shorthand property combines the flex-direction and flex-wrap properties into a single declaration.

Order

The order property determines the order in which the flex items appear within the container. Items with a lower order value appear first.

Flexbox

CSS Layout

Floats

Positioning

Flexbox

CSS Grid

Flexbox is designed for one-dimensional content, meaning it arranges content in a single line.

The main axis is the line along which flex items are arranged, either horizontally or vertically, while the cross axis is perpendicular to the main axis.

Certain properties of flexbox, such as order, can negatively impact accessibility when the visual order is not the same as the logical order.

Advantages of using flexbox over float include easier centering of content, automatic equalizing of container heights, and better support for responsive design.

I may be able to use flexbox to create a boggle / tangleword clone I am working on. However, I think that the grid system may be better.