CSS Flex Box Layout Fit

- 04.25

Ferrite Sheets | LairdTech
photo src: www.lairdtech.com

CSS Flex Box Layout is a CSS3 web layout model. It is in the W3C's Candidate Recommendation (CR) stage. The flex layout allows responsive elements within a container to be automatically arranged depending upon screen size (or device).


We Make it Easy to Make Your Sleep Number® FlexTop™ Mattress - YouTube
photo src: www.youtube.com


Maps, Directions, and Place Reviews



Concepts

One of the most defining features of the flex layout is its ability to form-fit, based on its viewing environment. Flex boxes can adjust in size--either decreasing, to avoid unnecessarily monopolizing space, or increasing to make room for contents to be constrained within its boundaries. Moreover, the flex layout is less restrictive in terms of content flow than those, for example, of the block and inline display types, which are generally uni-directional. Indeed, not only can flex directional flow be specified, at the style level, as rightwards, leftwards, upwards, or downwards; individual items within a flex container may also be automatically reordered and rearranged to suit the available layout space.


Ferrite Sheets | LairdTech
photo src: www.lairdtech.com


History

In the 2000s the intensive internet access by mobile agents motivated "liquid layouts" and responsive elements for the growing variety of screen sizes. In the 2010s, the intensive use of popular javascript layout frameworks, like Bootstrap, inspired CSS Flexbox and Grid Layout specifications.


Port Authority® Flexfit® Mesh Back Cap - Port Authority
photo src: ptemb.com


Terminology

Following are a few terms associated with the flex layout model

Flex container

Flex item

Axes

Flex-direction

Justify-content

Align-items

Align-content

Align-self

Directions

Order

Flex-flow

Lines

Dimensions


How to Install Round Sheet Metal Duct: Job Planning and Duct Diagram
photo src: www.handymanhowto.com


Designate a flex box

Designating an element as a flex element is relatively easy. All that is necessary is to set the display property to either flex or inline-flex as follows:

Or:

By setting the display to one of the two values above, an element becomes a flex container and its children flex items. Setting the display to flex makes the container a block-level element, while setting the display to inline-flex makes the container an inline-level element.


Clad IN_ECO Sheet_Print.jpg
photo src: www.kflexusa.com


Align to center

One of flexbox's advantages is the ability to easily align items within the container to the center of a page, both vertically and horizontally.

Source of the article : Wikipedia



EmoticonEmoticon

 

Start typing and press Enter to search