DEV Community

Sujith V S
Sujith V S

Posted on • Edited on

3 2

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 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

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay