Flex box テンプレ

Last-modified: 2021-06-18 (金) 06:15:36
Usage:
#flex_container([配置方法[,列幅の初期値[,折返し方式]]]){{{
...
}}}
例:
#flex_container{{{
#flex_box(200){{
1列目
}}
#flex_box(200){{
2列目
}}
}}}
例:
#flex_container(space-between, 33%){{{
#flex_box{{
1列目
}}
#flex_box{{
2列目
}}
}}}
例:
#flex_container(,300,nowrap){{{
#flex_box{{
1列目
}}
#flex_box{{
2列目
}}
}}}

その2

flex_container 引数(オプション)

位置による配置
centerflex_boxを中央に寄せる
flex-startflex_box,flex_containerを先頭に寄せる
flex-endflex_box,flex_containerを末尾に寄せる
均等配置
space-between各flex_boxを均等に配置し最初のflex_boxは先頭に寄せ、最後のflex_boxは
末尾に寄せる
space-around各flex_boxを均等に配置し各flex_boxの両側に半分の大きさの間隔を置く
space-evenly各flex_boxを均等に配置し各flex_boxの周りに同じ大きさの間隔を置く*IE11
非対応
stretch各flex_boxを均等に配置し明示的なサイズ指定がないflex_boxは、flex_containerに合わせて引き伸ばす*IE11非対応

列幅の初期値

幅を指定する
なにも書かないブラウザにおまかせで内容や flex_content によって自動的に幅が決まる
px固定幅 例:#flex_container(flex-start,300){{{...
%親のflex_containerの main size に対する% 例:#flex_container(flex-start,33%){{{...