Flexbox Cheatsheet: Difference between revisions
mNo edit summary |
mNo edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<!--opening table tag for entire document----------------------------------> | <!--opening table tag for entire document----------------------------------> | ||
<div style="border:5px solid darkred; border-radius:10px; background:#FFE4B5; width:1170px; height:100%; padding:10px; margin-bottom:10px; box-shadow:5px 5px 3px #888888"><span style="font-size:36px; font-family:arial; padding:10px">FLEXBOX CHEATSHEET</span><br>Condensed guide to Wikitext coding | |||
<div style=" | |||
''Click on sort icon to put list in alphabetical order'' | ''Click on sort icon to put list in alphabetical order'' | ||
</div> | </div> | ||
*REMEMBER: All Flexbox coding of items requires that they are inside of a container, such as a "div" or "p" tag: | *REMEMBER: All Flexbox coding of items requires that they are inside of a container, such as a "div" or "p" tag: | ||
<div style="display:flex"> | |||
<div>Item 1</div> | |||
<div>Item 1</div> | |||
<div>Item 1</div> | |||
</div> | |||
<table style="max-width:1200px; border:2px solid green" class="sortable"> | <table style="max-width:1200px; border:2px solid green" class="sortable"> | ||
<tr style="background:#FFE4B5"> | <tr style="background:#FFE4B5"> | ||
Line 35: | Line 18: | ||
<!-----------------------------------display flex - horizontal display---------------------------------------------------------------------> | <!-----------------------------------display flex - horizontal display---------------------------------------------------------------------> | ||
<tr> | <tr> | ||
<td style="border:1px solid black; padding-left:5px">[[Help:Wiki University Flexbox - Display Horizontal#Placing objects in a row| | <td style="border:1px solid black; padding-left:5px">[[Help:Wiki University Flexbox - Display Horizontal#Placing objects in a row|Placing objects in rows]]</td> | ||
<td style="border:1px solid black; padding-left:5px"><nowiki>display:flex</nowiki></td> | <td style="border:1px solid black; padding-left:5px"><nowiki>display:flex</nowiki></td> | ||
<td style="border:1px solid black; padding:5px"> | <td style="border:1px solid black; padding:5px"> | ||
Line 107: | Line 90: | ||
<!----------------------------------flex:2------------------------------------------------------> | <!----------------------------------flex:2------------------------------------------------------> | ||
<tr> | <tr> | ||
<td style="border:1px solid black; padding-left:5px">[[Help:Wiki University Flexbox - Display Horizontal#Moving boxes around horizontally| | <td style="border:1px solid black; padding-left:5px">[[Help:Wiki University Flexbox - Display Horizontal#Moving boxes around horizontally|Different flex numbers]]</td> | ||
<td style="border:1px solid black; padding-left:5px"><nowiki>Different flex numbers</nowiki></td> | <td style="border:1px solid black; padding-left:5px"><nowiki>Different flex numbers</nowiki></td> | ||
<td style="border:1px solid black; padding:5px"> | <td style="border:1px solid black; padding:5px"> | ||
Line 168: | Line 151: | ||
<tr> | <tr> | ||
<td style="border:1px solid black; padding-left:5px">[[Help:Wiki University Flexbox - Display Horizontal#Moving boxes around horizontally|Centering horizontally]]</td> | <td style="border:1px solid black; padding-left:5px">[[Help:Wiki University Flexbox - Display Horizontal#Moving boxes around horizontally|Centering horizontally]]</td> | ||
<td style="border:1px solid black; padding-left:5px"><nowiki>display;flex; justify-content:center</nowiki><br>''<nowiki> | <td style="border:1px solid black; padding-left:5px"><nowiki>display;flex; justify-content:center</nowiki><br>''<nowiki>Place on each line where you want to center text or image horizontally</nowiki>''</td> | ||
<td style="border:1px solid black; padding:5px"> | <td style="border:1px solid black; padding:5px"> | ||
<div style="border:2px solid red; padding:2px"> | <div style="border:2px solid red; padding:2px"> | ||
Line 180: | Line 163: | ||
<tr> | <tr> | ||
<td style="border:1px solid black; padding-left:5px">[[Help:Wiki University Flexbox - Display Horizontal#Moving boxes around horizontally|Centering vertically]]</td> | <td style="border:1px solid black; padding-left:5px">[[Help:Wiki University Flexbox - Display Horizontal#Moving boxes around horizontally|Centering vertically]]</td> | ||
<td style="border:1px solid black; padding-left:5px"><nowiki>display:flex; align-items:center</nowiki><br>''<nowiki> | <td style="border:1px solid black; padding-left:5px"><nowiki>display:flex; align-items:center</nowiki><br>''<nowiki>Place on each line where you want to center text or image vertically</nowiki>''</td> | ||
<td style="border:1px solid black; padding:5px"> | <td style="border:1px solid black; padding:5px"> | ||
<div style="border:2px solid red; padding:2px"> | <div style="border:2px solid red; padding:2px"> | ||
Line 192: | Line 175: | ||
<tr> | <tr> | ||
<td style="border:1px solid black; padding-left:5px">[[Help:Wiki University Flexbox - Display Horizontal#Moving boxes around horizontally|Centering vertically & Horizontally]]</td> | <td style="border:1px solid black; padding-left:5px">[[Help:Wiki University Flexbox - Display Horizontal#Moving boxes around horizontally|Centering vertically & Horizontally]]</td> | ||
<td style="border:1px solid black; padding-left:5px"><nowiki>display:flex; justify-content:center; align-items:center</nowiki><br>''<nowiki> | <td style="border:1px solid black; padding-left:5px"><nowiki>display:flex; justify-content:center; align-items:center</nowiki><br>''<nowiki>Place on each line where you want to center text or image vertically</nowiki>''</td> | ||
<td style="border:1px solid black; padding:5px"> | <td style="border:1px solid black; padding:5px"> | ||
<div style="border:2px solid red; padding:2px"> | <div style="border:2px solid red; padding:2px"> | ||
Line 215: | Line 198: | ||
</tr> | </tr> | ||
</table | </table> | ||
[[Category:Wikitext Lessons]] | |||
[[Category: |
Revision as of 09:04, 28 December 2016
FLEXBOX CHEATSHEET
Condensed guide to Wikitext coding
Condensed guide to Wikitext coding
Click on sort icon to put list in alphabetical order
- REMEMBER: All Flexbox coding of items requires that they are inside of a container, such as a "div" or "p" tag:
Item 1
Item 1
Item 1
Description | Flex coding | You Get |
---|---|---|
Placing objects in rows | display:flex |
1
2
3
|
Placing objects at end of containers | justify-content:flex-end |
1
2
3
|
Placing objects in the center of containers | justify-content:center |
1
2
3
|
Placing objects evenly spaced across a containter | justify-content:space-between |
1
2
3
|
Evenly spacing objects with space on either end | justify-content:space-around |
1
2
3
|
Placing objects at end of containers | flex:# |
1
2
3
|
Different flex numbers | Different flex numbers |
1
2
3
|
flex zero | Box one with flex number zero |
1
2
3
|
Change order in row | order:# |
1
2
3
|
Wrapping boxes in limited space | flex-wrap:wrap |
1
2
3
|
Placing objects in a column | flex-direction:column |
1
2
3
|
Centering horizontally | display;flex; justify-content:center Place on each line where you want to center text or image horizontally |
1
2
3
|
Centering vertically | display:flex; align-items:center Place on each line where you want to center text or image vertically |
1
2
3
|
Centering vertically & Horizontally | display:flex; justify-content:center; align-items:center Place on each line where you want to center text or image vertically |
1
2
3
|
Placing objects at opposite ends of containers | White box with flex:6 between items 1 and 2 |
1
2
3
|