DEV Community

Cover image for Complete Flexbox Tutorial w/ Cheat Sheet

Complete Flexbox Tutorial w/ Cheat Sheet

Joy Shaheb on January 10, 2021

Let's refresh Our CSS Flexbox Memory. Here's a Tutorial & Cheat Sheet of everything you can do with CSS flexbox. Let's Go 🎖️ The orig...
Collapse
 
cadams profile image
Chad Adams • Edited

This tool is awesome. Makes flexbox easy to understand. I use it alot.
demos.scotch.io/visual-guide-to-cs...

Collapse
 
jamesthomson profile image
James Thomson
Collapse
 
jamesthomson profile image
James Thomson

This is also good for beginners to see how common components can be structured. flexboxpatterns.com/

Thread Thread
 
ca969 profile image
ca969

Wow, that's a really good resource. Thank you for sharing.

Thread Thread
 
joyshaheb profile image
Joy Shaheb

Most welcome ❤️

Thread Thread
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
joyshaheb profile image
Joy Shaheb

A legend made this software, thank you for sharing this 🏅🙏

Collapse
 
kyril96340413 profile image
Kyril

Thanks

Collapse
 
Sloan, the sloth mascot
Comment deleted
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
ronaldohoch profile image
Ronaldo Hoch

Niiiice!
Why not this is a PWA?

Collapse
 
madza profile image
Madza

nice visuals, may I ask what you used? 👀

Collapse
 
joyshaheb profile image
Joy Shaheb

I took Images from Flaticon.com
I gave them credits before conclusion part

Collapse
 
madza profile image
Madza

Awesome, thanks! 🙏❤

Collapse
 
bayyash profile image
Bashar Ayyash

Can you please tell me whats the name of icons pack you used? I am a member at Flaticon, I liked the icons you used.

Collapse
 
qq449245884 profile image
qq449245884

Dear Joy Shaheb, may I translate your article into Chinese?I would like to share it with more developers in China. I will give the original author and original source.

Collapse
 
joyshaheb profile image
Joy Shaheb

Sure. Best of luck ❤️🎖️

Collapse
 
qq449245884 profile image
qq449245884

Thank You Very Much!

Collapse
 
nordyj profile image
Jamie Nordmeyer

Awesome reference. Thanks for this!

Collapse
 
rehan124 profile image
Rehan Jamali

Thank you sir... that's cool..but could I download or save it offline?? Bcz I have some Net issues

Collapse
 
joyshaheb profile image
Joy Shaheb

Sure,

Collapse
 
rehan124 profile image
Rehan Jamali

How could I download it offline?

Thread Thread
 
joyshaheb profile image
Joy Shaheb

Click on the image. Then download/save it/ take screenshots

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
joyshaheb profile image
Joy Shaheb

Thank you ❤️

Collapse
 
mbustosp profile image
Matías Bustos

Really good job! Thank you. It would be amazing if you could do something similar about Grids 😊

Collapse
 
joyshaheb profile image
Joy Shaheb

Thank you for the well wishes. I'll think about Grids in future. Till then, stay tuned ❤️

Collapse
 
kyril96340413 profile image
Kyril

Thank you for sharing this.

Collapse
 
joyshaheb profile image
Joy Shaheb

Most welcome ❤️

Collapse
 
olsha100 profile image
Olsha100 • Edited

Excellent article!

Collapse
 
alfreddagenais profile image
Alfred Dagenais

Wow, very simple to understand with pictures!! 😍 Finally, I'll get all info easily with flexbox! Thank

Collapse
 
joyshaheb profile image
Joy Shaheb

Most welcome ❤️

Collapse
 
keloxide profile image
Kellie

Awesome, i just learnt place-content...👍🏿

Collapse
 
anthonygrear profile image
anthony-grear

This is very good content. Well done!

Collapse
 
afif profile image
Temani Afif

note that order can be used with negative values

Collapse
 
dnjosh10 profile image
Dumte Nwidoobee Joshua

This tool makes me feel happy and confident. When next I will use my flexbox now, no more struggling with positioning child elements

Collapse
 
toqeer__abbas profile image
Toqeer Abbas
Collapse
 
robinkartikeyakhatri profile image
Robin Kartikeya Khatri

Thank you so much for sharing this wonderful resource.

Collapse
 
joyshaheb profile image
Joy Shaheb

Most welcome. In future , I'm planning to create a cheat sheet for CSS Grid model as well, Till then , stay tuned & take care ❤️

Collapse
 
epsi profile image
E.R. Nurwijayadi

Nice cheat.
Nice chat.
Nice cat.

Collapse
 
joyshaheb profile image
Joy Shaheb

This is epic man 🤣🤣
Take medals 🏅🏅

Collapse
 
tiiunder profile image
Felix G

Thanks for that! I love flex box but sometimes I hate it as well. But this cheat sheet gets a nice overview and hopefully reduces by frustration in the future.

Collapse
 
joyshaheb profile image
Joy Shaheb

Most welcome Felix,
You can follow me along if you're interested to get more contents like these in future.

Collapse
 
abdullaharik profile image
Abdullah Arık

Why we use flexbox or grid? What do you think of this?

Collapse
 
joyshaheb profile image
Joy Shaheb

Both of them are different type of Architecture. & they have the ability to produce the same results. It totally depends on the developer which architecture he/she likes to follow.

Collapse
 
profkache profile image
Salim Kachemela

Great article. Thanks for sharing.

Collapse
 
realtoughcandy profile image
RealToughCandy.io

Great resource for Flexbox. Nice work.

Collapse
 
joyshaheb profile image
Joy Shaheb

Thank you for the feedback 🏅❤️

Collapse
 
adriathomas profile image
Adrian Thomas

Is there a similar cheat sheet like this but for CSS Grid?

Collapse
 
joyshaheb profile image
Joy Shaheb

Will make it in the future if possible. Till then, stay tuned ❤️🏅

Collapse
 
developing_dev profile image
Cris Acosta

Thanks for sharing. This is an awesome resource!

Collapse
 
surajprasad13 profile image
Suraj Prasad

Nice presentation

Collapse
 
mvoloskov profile image
Miloslav 🏳️‍🌈 🦋 Voloskov

Nice pics but what about justify-self? What about gap that already works in every new browser except Safari? What about basics like flex-basis?

Perhaps I miss the purpose here.

Collapse
 
charly2009 profile image
charly2009

nice tutorial

Collapse
 
redbossrabbit profile image
Ibeh Ubachukwu

Amazing😁

Collapse
 
sujankh22371674 profile image
Sujan Khadka

Useful article.

Collapse
 
lindaojo profile image
Linda

Well explained!

Collapse
 
joyshaheb profile image
Joy Shaheb

Thank you ❤️

Collapse
 
zayidu profile image
Zayidu A

Thanks!

Collapse
 
joyshaheb profile image
Joy Shaheb

Most welcome ❤️

Collapse
 
mis0u profile image
Mickaël

Nice article. The little trick if you want to center an object (X and Y) in 2 lines :
display: grid;
place-items: center;

Collapse
 
florincornea profile image
Cornea Florin

Great effort, thanks Joy, very useful!

Collapse
 
joyshaheb profile image
Joy Shaheb

Most welcome ❤️

Collapse
 
hardikchopra profile image
Hardik Chopra

Great work 🤩 thank you so much 👍

Collapse
 
joyshaheb profile image
Joy Shaheb

Most welcome ❤️

Collapse
 
jamesthomson profile image
James Thomson

I've also found this useful for some of those pesky older browser flex bugs. github.com/philipwalton/flexbugs

Collapse
 
mahtamunhoquefahim profile image
Mahtamun Hoque Fahim

❤️️ !!

Collapse
 
joyshaheb profile image
Joy Shaheb

Thank you soo much for the well wishes. ❤️❤️🏅

Collapse
 
polodev profile image
polodev • Edited

I am also from Bangladesh. Feel good that, I am reading our vi brother post. Concise and clear idea on Flexbox. Thanks Joy

Collapse
 
joyshaheb profile image
Joy Shaheb

Thank you soo much for the well wishes bhaiya ❤️

Collapse
 
prayashshrestha profile image
prayashShrestha

thanku so much for this .. best wishes.

Collapse
 
satyamgupta1495 profile image
Satyam Gupta

If you use VS Code, there's an extension called Flex-Box cheat Sheet you can use that too!

Collapse
 
prabhukadode profile image
Prabhu

Good

Collapse
 
michalakis profile image
Michalis Efstathiou

Great post, Thanks!

Collapse
 
davistran86 profile image
davistran86

Very nice article, can you explain more on flex-grow, flex-shrink ?

Collapse
 
joyshaheb profile image
Joy Shaheb

Hello @davistran86 ,
Hopefully in future, I'll post an article/ youtube video explaining the topic in details with some examples, if possible. Till then, stay tuned & take care ❤️

Collapse
 
geosn0w profile image
GeoSn0w

This is awesome.

Collapse
 
tunlinphyo profile image
tunlinphyo

I didn't know there is warp-reverse. Thanks.

Collapse
 
suyash56 profile image
Suyash Balshetwar

flexboxfroggy.com This website is best to learn flex and apply it.

Collapse
 
developing_dev profile image
Cris Acosta

Thanks man! Really handy!

Collapse
 
joyshaheb profile image
Joy Shaheb

Most welcome ❤️

Collapse
 
genocideaon profile image
Pranat • Edited

How to fix width if I create a layout like this comment box, image profile was fixed width and the comment message box has flexible width. Or should not use flex.