Last active
August 26, 2017 15:26
-
-
Save chand/191bbe26053301aaf5a5de24c0078076 to your computer and use it in GitHub Desktop.
Revisions
-
chand revised this gist
Aug 26, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ align-items: align-content: ``` ### Flex Items: ``` order: align-self: -
chand revised this gist
Aug 26, 2017 . 1 changed file with 22 additions and 22 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,12 @@ # Flexbox Basics ## Overview <img src="http://samserif.co/lib/teaching/flexbox-class-slides/images/flexbox-main.png" width="600px"> ### Flex Container: ``` display: flex-direction: @@ -27,38 +27,38 @@ flex-basis: flex: ``` ## Flex Container Properties Control the direction of flex items within the parent container. ### Add the following code at the top of any container css to "activate" flexbox: ``` display: flex; ``` ### Set the direction of the box, options are (row is default): ``` flex-direction: row; flex-direction: row-reverse; flex-direction: column; flex-direction: column-reverse; ``` ### Set the wrap properties of the box (nowrap is default): ``` flex-wrap: nowrap; flex-wrap: wrap; flex-wrap: nowrap-reverse; ``` ### Flex-Flow is a short hand which sets both flex-direction and flex-wrap at once: ``` flex-flow: row nowrap; flex-flow: column wrap; ``` ## Control the direction of flex items along main and cross axes ### Main Axis/Left to Right(flex-start is default): ``` justify-content: flex-start; justify-content: flex-end; @@ -67,15 +67,15 @@ justify-content: space-between; justify-content: space-around; ``` ### Cross Axis/Top to Bottom (stretch is default): ``` align-items: stretch; align-items: flex-start; align-items: flex-end; align-items: center; align-items: baseline; ``` ### Cross Axis for content with more than one line (stretch is default): ``` align-content: stretch; align-content: flex-start; @@ -85,16 +85,16 @@ align-content: space-between; align-content: space-around; ``` ## Flex Item Properties Overrides position of individual flex items along main or cross axis ### To change order of appearance (not actual HTML order): ``` order: 1; ``` Value can be any positive of negative integer ### To override align-items position on cross axis ``` align-self: flex-start; align-self: flex-end; @@ -103,45 +103,45 @@ align-self: stretch; align-self: baseline; ``` ### Override justify-content positioning on main exis to fill extra space: ``` margin-left: auto; margin-right: auto; ``` ## Control the amount of space flex items will grow or shrink to fill based on container size ### Flex Grow Specifies the flex grow factor of a flex item. Default is 0. ``` flex-grow: 0; flex-grow: [any integer]; flex-grow: auto; ``` ### Flex Shrink Specifies the flex shrink factor of a flex item. Default is 1. ``` flex-shrink: 1; flex-shrink: [any integer]; flex-shrink: auto; ``` ### Flex Basis Specifies the initial size of the flex item, before any available space is distributed according to the flex factors. Default is 0. ``` flex-basis: 0; flex-basis: [any integer]; flex-basis: auto; ``` ### Shorthand flex-grow value / flex-shrink value / flex-basis value ``` flex: 0 1 0; ``` ### Useful default values for flex values ``` flex: initial; //equivalent to flex: 0 1 auto; -
chand revised this gist
Nov 16, 2016 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,8 +33,8 @@ Control the direction of flex items within the parent container. ###Add the following code at the top of any container css to "activate" flexbox: ``` display: flex; ``` ###Set the direction of the box, options are (row is default): ``` flex-direction: row; @@ -56,7 +56,7 @@ flex-flow: row nowrap; flex-flow: column wrap; ``` ##Control the direction of flex items along main and cross axes ###Main Axis/Left to Right(flex-start is default): ``` @@ -86,7 +86,6 @@ align-content: space-around; ``` ##Flex Item Properties Overrides position of individual flex items along main or cross axis ###To change order of appearance (not actual HTML order): -
chand revised this gist
Nov 16, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ ##Overview <img src="http://samserif.co/lib/teaching/flexbox-class-slides/images/flexbox-main.png" width="600px"> -
chand created this gist
Nov 16, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,161 @@ #Flexbox Basics ##Overview [<img src="http://samserif.co/lib/teaching/flexbox-class-slides/images/flexbox-main.png" width="400px">] ###Flex Container: ``` display: flex-direction: flex-wrap: flex-flow: justify-content: align-items: align-content: ``` ###Flex Items: ``` order: align-self: flex-grow: flex-shrink: flex-basis: flex: ``` ##Flex Container Properties Control the direction of flex items within the parent container. ###Add the following code at the top of any container css to "activate" flexbox: ``` display: flex; ``` ###Set the direction of the box, options are (row is default): ``` flex-direction: row; flex-direction: row-reverse; flex-direction: column; flex-direction: column-reverse; ``` ###Set the wrap properties of the box (nowrap is default): ``` flex-wrap: nowrap; flex-wrap: wrap; flex-wrap: nowrap-reverse; ``` ###Flex-Flow is a short hand which sets both flex-direction and flex-wrap at once: ``` flex-flow: row nowrap; flex-flow: column wrap; ``` Control the direction of flex items along main and cross axes ###Main Axis/Left to Right(flex-start is default): ``` justify-content: flex-start; justify-content: flex-end; justify-content: center; justify-content: space-between; justify-content: space-around; ``` ###Cross Axis/Top to Bottom (stretch is default): ``` align-items: stretch; align-items: flex-start; align-items: flex-end; align-items: center; align-items: baseline; ``` ###Cross Axis for content with more than one line (stretch is default): ``` align-content: stretch; align-content: flex-start; align-content: flex-end; align-content: center; align-content: space-between; align-content: space-around; ``` ##Flex Item Properties Overrides position of individual flex items along main or cross axis ###To change order of appearance (not actual HTML order): ``` order: 1; ``` Value can be any positive of negative integer ###To override align-items position on cross axis ``` align-self: flex-start; align-self: flex-end; align-self: center; align-self: stretch; align-self: baseline; ``` ###Override justify-content positioning on main exis to fill extra space: ``` margin-left: auto; margin-right: auto; ``` ##Control the amount of space flex items will grow or shrink to fill based on container size ###Flex Grow Specifies the flex grow factor of a flex item. Default is 0. ``` flex-grow: 0; flex-grow: [any integer]; flex-grow: auto; ``` ###Flex Shrink Specifies the flex shrink factor of a flex item. Default is 1. ``` flex-shrink: 1; flex-shrink: [any integer]; flex-shrink: auto; ``` ###Flex Basis Specifies the initial size of the flex item, before any available space is distributed according to the flex factors. Default is 0. ``` flex-basis: 0; flex-basis: [any integer]; flex-basis: auto; ``` ###Shorthand flex-grow value / flex-shrink value / flex-basis value ``` flex: 0 1 0; ``` ###Useful default values for flex values ``` flex: initial; //equivalent to flex: 0 1 auto; flex: auto; //equivalent to flex: 1 1 auto; flex: none; //equivalent to flex: 0 0 auto; flex: integer; //equivalent to flex: [integer] 1 0; ```