Reputation: 755
I tried everything I can. But it doesnt work. I want to use flexbox to make my elements inline, with this code:
<div style={{
flex: 1,
flexDirection: 'column',
justifyContent: 'center',
}}>
<div style={{width: 50, height: 50, backgroundColor: 'powderblue'}} />
<div style={{width: 50, height: 50, backgroundColor: 'skyblue'}} />
<div style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />
</div>
Everything I do, it only renders by columns. Someone can save my life?
Upvotes: 0
Views: 242
Reputation: 36219
You should use row
instead of column
if you want them inline:
<div
style={{
display: 'flex',
flexFlow: "row nowrap",
justifyContent: 'center',
}}
>
<div style={{width: 50, height: 50, backgroundColor: 'powderblue'}} />
<div style={{width: 50, height: 50, backgroundColor: 'skyblue'}} />
<div style={{width: 50, height: 50, backgroundColor: 'steelblue'}} />
</div>
flex
is a property for children elements.
Upvotes: 4