

CSS flexbox cheatsheet
source link: https://devhints.io/css-flexbox
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Simple example
.container {
display: flex;
}
.container > div {
flex: 1 1 auto;
}
Container
.container {
display: flex;
display: inline-flex;
flex-direction: row; /* ltr - default */
flex-direction: row-reverse; /* rtl */
flex-direction: column; /* top-bottom */
flex-direction: column-reverse; /* bottom-top */
flex-wrap: nowrap; /* one-line */
flex-wrap: wrap; /* multi-line */
align-items: flex-start; /* vertical-align to top */
align-items: flex-end; /* vertical-align to bottom */
align-items: center; /* vertical-align to center */
align-items: stretch; /* same height on all (default) */
justify-content: flex-start; /* [xxx ] */
justify-content: center; /* [ xxx ] */
justify-content: flex-end; /* [ xxx] */
justify-content: space-between; /* [x x x] */
justify-content: space-around; /* [ x x x ] */
justify-content: space-evenly; /* [ x x x ] */
}
Child
.container > div {
/* This: */
flex: 1 0 auto;
/* Is equivalent to this: */
flex-grow: 1;
flex-shrink: 0;
flex-basis: auto;
order: 1;
align-self: flex-start; /* left */
margin-left: auto; /* right */
}
Recommend
-
36
翻译:疯狂的技术宅 原文: https://medium.com/swlh/css-f... 本文首发微信公众号:jingchengyideng 欢迎关注...
-
33
Flexbox cheatsheet – 12 tips and tricks every web developer should know by Anna Danilec | Nov 1, 2019
-
10
@joyshahebJoy ShahebFront end Developer 🔥 || Youtuber 🎬|| Blogger ✍|| K-pop fan ❤️️based in Dhaka, Bangladesh.
-
11
Published on 6 April 2021 in css Use case comparison between CSS Grid and Flexbox Responsive design is a must-have in web design right now. And that c...
-
6
What is CSS Flexbox CSS Flexbox is a one-dimensional layout module that can be used to make your applications more responsive. Flexbox allows you to dynamically control alignment, direction, and space of content insi...
-
9
CSS Flexbox Cheat Sheet 🔥 Hi dev friends! I made this cheat sheet to help my students. I shared it on Twitter here and it got vir...
-
8
Difference between CSS Grid and Flexbox Reading Time: 5 minutes The way you display your content on can say a lot about yo...
-
14
CSS Flexbox Tutorial: The Basics By Naincy Mourya Published 4 hours ago Perfectly position your HTML elements with the help of C...
-
17
CSS Flexbox vs Grid layoutUnderstanding the differences between the two CSS layout models.Flexbox and Grid are two CSS layout models that can be used to create complex web app...
-
10
In this video, I have shown you how you can create a responsive footer section using HTML and CSS only. Source Code: HTML <!DOCTYPE html> <...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK