├── css
├── flexWrap.css
├── flexDirection.css
├── alignSelf.css
├── order.css
├── alignContent.css
├── flexBasis.css
├── flexGrow.css
├── alignItems.css
├── justifyContent.css
├── flexShrink.css
├── index.css
└── boilerplate.css
├── README.md
├── flexGrow.html
├── flexShrink.html
├── order.html
├── flexDirection.html
├── flexWrap.html
├── alignSelf.html
├── flexBasis.html
├── alignItems.html
├── index.html
├── justifyContent.html
├── alignContent.html
└── assests
└── favion.svg
/css/flexWrap.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #ff9d76;
3 | }
4 |
5 | .flex-container {
6 | flex-direction: row;
7 | }
8 |
9 | .nowrap {
10 | flex-wrap: nowrap;
11 | }
12 |
13 | .wrap {
14 | flex-wrap: wrap;
15 | }
16 |
17 | .wrap-reverse {
18 | flex-wrap: wrap-reverse;
19 | }
20 |
--------------------------------------------------------------------------------
/css/flexDirection.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #9ad3bc;
3 | }
4 |
5 | .flex-container {
6 | display: flex;
7 | color: white;
8 | }
9 |
10 | .row {
11 | flex-direction: row;
12 | }
13 |
14 | .row-reverse {
15 | flex-direction: row-reverse;
16 | }
17 |
18 | .column {
19 | flex-direction: column;
20 | }
21 |
22 | .column-reverse {
23 | flex-direction: column-reverse;
24 | }
25 |
--------------------------------------------------------------------------------
/css/alignSelf.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #fe6845;
3 | }
4 |
5 | .flex-container {
6 | flex-direction: row;
7 | height: 240px;
8 | align-items: flex-start;
9 | }
10 | .sample1 div:nth-child(2) {
11 | align-self: flex-start;
12 | }
13 |
14 | .sample2 div:nth-child(2) {
15 | align-self: flex-end;
16 | }
17 |
18 | .sample3 div:nth-child(2) {
19 | align-self: center;
20 | }
21 |
22 | .sample4 div:nth-child(2) {
23 | align-self: stretch;
24 | }
25 |
--------------------------------------------------------------------------------
/css/order.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #617be3;
3 | }
4 |
5 | .flex-container {
6 | flex-flow: row wrap;
7 | }
8 |
9 | /* Seclecting All the Children of Sample1 class */
10 | .sample1 > * {
11 | order: 0;
12 | }
13 |
14 | .sample2 div:nth-child(2) {
15 | order: 1;
16 | }
17 |
18 | .sample2 div:nth-child(4) {
19 | order: -1;
20 | }
21 |
22 | .sample3 div:nth-child(1) {
23 | order: 1;
24 | }
25 |
26 | .sample3 div:nth-child(2) {
27 | order: 2;
28 | }
29 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Flexbox-Cheatsheet
2 | This is a Flexbox cheatsheet, made using CSS Flexbox.
3 |
4 | 
5 |
6 |
7 | ## Tech Stack
8 |
9 |
10 |
--------------------------------------------------------------------------------
/css/alignContent.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #50d890;
3 | }
4 |
5 | .flex-container {
6 | height: 280px;
7 | flex-direction: row;
8 | align-items: flex-start;
9 | flex-wrap: wrap;
10 | }
11 |
12 | .start {
13 | align-content: flex-start;
14 | }
15 |
16 | .end {
17 | align-content: flex-end;
18 | }
19 |
20 | .center {
21 | align-content: center;
22 | }
23 | .space-between {
24 | align-content: space-between;
25 | }
26 |
27 | .space-around {
28 | align-content: space-around;
29 | }
30 |
--------------------------------------------------------------------------------
/css/flexBasis.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #1a2849;
3 | }
4 |
5 | .flex-container {
6 | flex-direction: row;
7 | justify-content: flex-start;
8 | }
9 |
10 | .sample1 div:nth-child(2) {
11 | flex-basis: 200px;
12 | }
13 |
14 | .sample2 div:nth-child(2) {
15 | flex-basis: 33%;
16 | }
17 |
18 | /* .sample3 > * {
19 | flex-grow: 1;
20 | } */
21 | .sample3 > * {
22 | flex-basis: 25%;
23 | }
24 |
25 | .sample4 > * {
26 | flex: 0 1 auto;
27 | }
28 |
29 | .sample5 > * {
30 | flex: 1 1 25%;
31 | }
32 |
--------------------------------------------------------------------------------
/css/flexGrow.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #6fb98f;
3 | }
4 |
5 | .head-container {
6 | display: flex;
7 | flex-direction: column;
8 | align-items: center;
9 | }
10 |
11 | .flex-container {
12 | flex-direction: row;
13 | align-items: flex-start;
14 | width: 600px;
15 | }
16 |
17 | .sample1 > * {
18 | flex-grow: 0;
19 | }
20 |
21 | .sample2 > * {
22 | flex-grow: 1;
23 | }
24 |
25 | .sample3 :nth-child(2) {
26 | flex-grow: 1;
27 | }
28 |
29 | .sample3 :nth-child(3) {
30 | flex-grow: 2;
31 | }
32 |
--------------------------------------------------------------------------------
/css/alignItems.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #d89cf6;
3 | }
4 |
5 | .flex-container {
6 | height: 200px;
7 | }
8 |
9 | .start {
10 | align-items: flex-start;
11 | }
12 |
13 | .end {
14 | align-items: flex-end;
15 | }
16 |
17 | .center {
18 | align-items: center;
19 | }
20 |
21 | .baseline {
22 | align-items: baseline;
23 | }
24 | .baseline div:nth-child(2) {
25 | font-size: 16px;
26 | }
27 | .baseline div:nth-child(4) {
28 | font-size: 36px;
29 | }
30 |
31 | .stretch {
32 | align-items: stretch;
33 | }
34 |
--------------------------------------------------------------------------------
/css/justifyContent.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #9ad3bc;
3 | }
4 |
5 | .flex-container {
6 | flex-direction: row;
7 | }
8 |
9 | .start {
10 | justify-content: flex-start;
11 | }
12 |
13 | .end {
14 | justify-content: flex-end;
15 | }
16 |
17 | .center {
18 | justify-content: center;
19 | }
20 |
21 | .space-around {
22 | justify-content: space-around;
23 | }
24 | .space-between {
25 | justify-content: space-between;
26 | }
27 |
28 | .column-center {
29 | justify-content: space-between;
30 | flex-direction: column;
31 | height: 500px;
32 | }
33 |
--------------------------------------------------------------------------------
/css/flexShrink.css:
--------------------------------------------------------------------------------
1 | body {
2 | background-color: #3fc5f0;
3 | }
4 |
5 | .head-container {
6 | display: flex;
7 | flex-direction: column;
8 | align-items: center;
9 | }
10 |
11 | .flex-container {
12 | flex-direction: row;
13 | justify-content: flex-start;
14 | width: 600px;
15 | }
16 |
17 | .flex-container > * {
18 | width: 250px;
19 | }
20 |
21 | .sample1 > * {
22 | flex-shrink: 1;
23 | }
24 |
25 | .sample2 div:nth-child(2) {
26 | flex-shrink: 0;
27 | }
28 |
29 | .sample3 div:nth-child(2) {
30 | flex-shrink: 2;
31 | }
32 |
33 | .sample3 div:nth-child(3) {
34 | flex-shrink: 3;
35 | }
36 |
--------------------------------------------------------------------------------
/css/index.css:
--------------------------------------------------------------------------------
1 | .container {
2 | display: flex;
3 | flex-flow: row wrap;
4 | }
5 |
6 | .container > * {
7 | color: #fff;
8 | background-color: #d44000d7;
9 | border: 1px solid #fff;
10 | padding: 20px;
11 | margin: 5px;
12 | justify-content: space-between;
13 | text-align: center;
14 | min-width: 250px;
15 | flex-grow: 1;
16 | align-content: space-between;
17 | }
18 |
19 | .container > *:hover {
20 | background-color: #ff7a00;
21 | }
22 |
23 | a {
24 | text-decoration: none;
25 | color: #fff;
26 | }
27 |
28 | /* */
29 | .ml6 {
30 | position: relative;
31 | font-weight: 900;
32 | font-size: 3em;
33 | text-align: center;
34 | padding-top: 0;
35 | color: orangered;
36 | margin: 0;
37 | }
38 |
39 | .ml6 .text-wrapper {
40 | position: relative;
41 | display: inline-block;
42 | /* padding-top: 0.2em;
43 | padding-right: 0.05em;
44 | padding-bottom: 0.1em; */
45 | overflow: hidden;
46 | }
47 |
48 | .ml6 .letter {
49 | display: inline-block;
50 | line-height: 1em;
51 | }
52 |
--------------------------------------------------------------------------------
/flexGrow.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
The flex-grow property specifies how much a flex item will grow relative to the rest of the flex 19 | items.
20 |The flex-shrink property specifies how much a flex item will shrink relative to the rest of the flex 19 | items. 20 |
21 |The order property specifies the order of the flex items.
19 |All the items have by default order 0
20 |21 | The flex-direction property defines in which direction the 22 | container wants to stack the flex items. 23 |
24 |21 | The flex-wrap property specifies whether the flex items should 22 | wrap or not. 23 |
24 |The align-self property specifies the alignment for the selected item inside the flexible 19 | container. 20 |
21 |The align-self property overrides the default alignment set by the container's align-items property. 22 |
23 |The flex-basis property specifies the initial length of a flex item
19 |The flex property is a shorthand property for the flex-grow ,flex-shrink, and flex- basis property
55 |The align-items property is used to align the flex items along cross-axis.
19 |The justify-content property is used to align the flex items along main axis
19 |The align-content property is used to align the flex lines.
21 |