Css Flexbox Cheat Sheet

flexbox – used to align items perfectly.
grid – can also be used to align items.
————————————————————————–
flex container – is the element that holds flex items.
display:flex.
flex item…


This content originally appeared on DEV Community and was authored by Sujith V S

flexbox - used to align items perfectly.
grid - can also be used to align items.
--------------------------------------------------------------------------
flex container - is the element that holds flex items.
                 display:flex.
flex items - direct children of flex container
eg:
<div class="flex-container">
    <div>Flex item 1</div>
    <div>Flex item 2</div>
    <div>Flex item 3</div>
</div>

**Flex Container Properties:**  
flex-direction - row,column
flex-wrap -value:wrap( to adjust flex items to the next line, if all the items doesnt fit in one line, works only when the width or basis is specified.)
flex-flow
justify-content(main axis) = start,end,center,space-around,space-between
align-items(cross axis) = end,start,center(align-self:to align a single flex item[flex item proprety])
align-content

**Flex item Properties:**
order - values:1,2,3..(to change the order of items in flex container)
flex-grow - value:1,2,3..(size of flex item, when it grows)(it also take the whole width of the container)
flex-shrink - value:1,2,3..(size of flex item, when it shrinks)
flex-basis - same as width.
align-self = end,start,center(to align a single flex item specifically.)
shortcut= flex: flex-grow flex-shrink flex-basis 
----------------------------------------------------------------------------


This content originally appeared on DEV Community and was authored by Sujith V S


Print Share Comment Cite Upload Translate Updates
APA

Sujith V S | Sciencx (2022-04-29T18:49:03+00:00) Css Flexbox Cheat Sheet. Retrieved from https://www.scien.cx/2022/04/29/css-flexbox-cheat-sheet/

MLA
" » Css Flexbox Cheat Sheet." Sujith V S | Sciencx - Friday April 29, 2022, https://www.scien.cx/2022/04/29/css-flexbox-cheat-sheet/
HARVARD
Sujith V S | Sciencx Friday April 29, 2022 » Css Flexbox Cheat Sheet., viewed ,<https://www.scien.cx/2022/04/29/css-flexbox-cheat-sheet/>
VANCOUVER
Sujith V S | Sciencx - » Css Flexbox Cheat Sheet. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/04/29/css-flexbox-cheat-sheet/
CHICAGO
" » Css Flexbox Cheat Sheet." Sujith V S | Sciencx - Accessed . https://www.scien.cx/2022/04/29/css-flexbox-cheat-sheet/
IEEE
" » Css Flexbox Cheat Sheet." Sujith V S | Sciencx [Online]. Available: https://www.scien.cx/2022/04/29/css-flexbox-cheat-sheet/. [Accessed: ]
rf:citation
» Css Flexbox Cheat Sheet | Sujith V S | Sciencx | https://www.scien.cx/2022/04/29/css-flexbox-cheat-sheet/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.