https://facebook.github.io/react-native/docs/flexbox/css
https://reactnative.cn/docs/flexbox/html
https://www.ruanyifeng.com/blog/2015/07/flex-grammar.htmlreact
採用 Flex 佈局的元素,稱爲 Flex 容器(flex container),簡稱"容器"。它的全部子元素自動成爲容器成員,稱爲 Flex 項目(flex item),簡稱"項目"。css3
容器默認存在兩根軸:水平的主軸(main axis)和垂直的交叉軸(cross axis)。git
容器的 6個屬性github
flex-direction: row | row-reverse | column | column-reverse;
& default value(row)react-native
flex-wrap: nowrap | wrap | wrap-reverse;
& default value(nowrap)ide
https://codepen.io/team/css-tricks/pen/1ea1ef35d942d0041b0467b4d39888d3佈局
flex-flow
is shorthandflex-direction
&flex-wrap
flex
flex-flow: <‘flex-direction’> || <‘flex-wrap’>
& default value(row nowrap)
justify-content: flex-start | flex-end | center | space-between | space-around | space-evenly;
& default value(flex-start)
align-items: stretch | flex-start | flex-end | center | baseline;
& default value(stretch)
align-content: flex-start | flex-end | center | space-between | space-around | stretch;
& default value(flex-start)
項目的 6個屬性
order: <integer>;
& default value(0)
flex-grow: <number>;
& default value(0)
flex-shrink: <number>;
& default value(1)
flex-basis: <length> | auto;
& default value(auto)
flex is shorthand for
flex-grow
&flex-shrink
&flex-basis
flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]
& default value(0 1 auto)
align-self: auto | flex-start | flex-end | center | baseline | stretch;
& default value(auto)
align-self 屬性容許單個項目有與其餘項目不同的對齊方式,可覆蓋align-items屬性。默認值爲auto,表示繼承父元素的align-items屬性,若是沒有父元素,則等同於stretch
https://css-tricks.com/snippets/css/a-guide-to-flexbox/
https://www.w3schools.com/css/css3_flexbox.asp
https://zh.learnlayout.com/flexbox.html
https://www.ruanyifeng.com/blog/2019/03/grid-layout-tutorial.html