Flexbox Cheatsheet: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 144: | Line 144: | ||
<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 153: | Line 153: | ||
</div></div></td> | </div></div></td> | ||
</tr> | </tr> | ||
<!-------------------------------------------align-items:center---------------------------------------------------------> | |||
<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|Centering vertically]]</td> | ||
<td style="border:1px solid black; padding-left:5px"><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"> | ||
<div style="display:flex; justify-content:flex-end"> | <div style="display:flex; justify-content:flex-end"> | ||
<div style="height:50px; width:30px; background-color:yellow">1</div> | <div style="display:flex; align-items:center; height:50px; width:30px; background-color:yellow">1</div> | ||
<div style="height:50px; width:30px; background-color:orange">2</div> | <div style="display:flex; align-items:center; height:50px; width:30px; background-color:orange">2</div> | ||
<div style="height:50px; width:30px; background-color:red">3</div> | <div style="display:flex; align-items:center; height:50px; width:30px; background-color:red">3</div> | ||
</div></div></td> | </div></div></td> | ||
</tr> | </tr> |
Revision as of 13:22, 27 December 2016
FLEXBOX CHEATSHEET
Condensed guide to Wikitext coding
<1--------------------------------------flexbox wraping------------------------------------------------>
Condensed guide to Wikitext coding
Click on sort icon to put list in alphabetical order
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
|
Placing objects at end of containers | justify-content:flex-end |
1
2
3
|
Placing objects at end of containers | justify-content:flex-end |
1
2
3
|
Placing objects at end of containers | justify-content:flex-end |
1
2
3
|
Placing objects at end of containers | justify-content:flex-end |
1
2
3
|