Flexbox
CSS Flexible Box Layout, commonly known as Flexbox, is a CSS 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 on viewport (device screen) size.
CSS Flexible Box Layout, commonly known as Flexbox, is a CSS 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 on viewport (device screen) size. ==Terminology== The following terms are associated with the flexbox layout model. Flex container Parent element that holds all flex items. Using the CSS display property, the container can be defined as either flex or inline-flex. Flex item Any direct child element held within the flex container is considered a flex item. Any text within the container element is wrapped in an unknown flex item. Axes Each flex box contains two axes: the main and cross axes. The main axis is the axis on which the items align with each other. The cross axis is perpendicular to the main axis. Flex-direction Establishes main axis. Possible arguments: row (default), row-reverse, column, column-reverse. Justify-content Determines how content gets placed on the main axis on the current line. Optional arguments: left, right, center, space-between, space-around. Align-items Determines the default for how flex items get placed on the cross axis on each line. Align-content Determines the default for how cross axis lines are aligned. Align-self Determines how a single item is placed along the cross axis. This overrides any defaults set by align-items. display: flex; Or: display: inline-flex; 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. 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. .container { display: flex; align-items: center; justify-content: center; } ==References==
References
- ^ Bail, Jeff (2012-10-23). "Use CSS media queries to create responsive websites" . IBM Developer . Archived from the original on 2020-10-13 . Retrieved 2021-04-08 . Wikipedia revision 1378909525, retrieved 2026-11-18 · 1617836400.0
- ^ Flexible Box Layout Module, W3C Working Draft, 23 July 2009 Wikipedia revision 1378909525, retrieved 2026-11-18 · 1794956400.0
- ^ a b Shepherd, Richard (2011-09-19). "CSS3 Flexible Box Layout: Everything I Wish I Knew When I Started" . Smashing Magazine . Retrieved 2021-04-08 . Wikipedia revision 1378909525, retrieved 2026-11-18 · 1617836400.0
- ^ "CSS Flexible Box Layout Module" . Can I use . Retrieved 2020-09-03 . Wikipedia revision 1378909525, retrieved 2026-11-18 · 1599087600.0
- ^ "CSS Flexible Box Layout Module Level 1 Publication History - W3C" . W3C . n.d . Retrieved 2021-04-08 . Wikipedia revision 1378909525, retrieved 2026-11-18 · 1617836400.0
- ^ a b c d e f g Atkins Jr., Tab; Etemad, Elika J.; Atanassov, Rossen; Mogilevsky, Alex; Baron, L. David; Deakin, Neil; Hickson, Ian; Hyatt, David, eds. (2018-11-09). "CSS Flexible Box Layout Module Level 1" . W3C . Retrieved 2021-04-08 . Wikipedia revision 1378909525, retrieved 2026-11-18 · 1617836400.0
- ^ Atkins Jr., Tab; Etemad, Elika J.; Atanassov, Rossen; Brufau, Oriol; Mogilevsky, Alex; Cupp, Phil, eds. (2020-12-18). "CSS Grid Layout Module Level 1" . W3C . CSS Working Group . Retrieved 2021-04-08 . Wikipedia revision 1378909525, retrieved 2026-11-18 · 1617836400.0
- ^ a b Atkins Jr, Tab; Etemad, Elika J.; Atanassov, Rossen; Mogilevsky, Alex; Baron, L. David; Deakin, Neil; Hickson, Ian; Hyatt, David, eds. (2021-03-25). "CSS Flexible Box Layout Module Level 1" . CSS Working Group Editor Drafts . Retrieved 2021-04-08 . Wikipedia revision 1378909525, retrieved 2026-11-18 · 1617836400.0
- ^ a b "Basic concepts of flexbox" . MDN Web Docs . n.d . Retrieved 2021-04-08 . Wikipedia revision 1378909525, retrieved 2026-11-18 · 1617836400.0
Cite this
"Flexbox". 1791315326. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1378909525