Css 如何使用“flex display”分隔两个按钮。
我想使用Css 如何使用“flex display”分隔两个按钮。,css,reactjs,flexbox,Css,Reactjs,Flexbox,我想使用flex display来分隔两个按钮 现在,我正在使用react const style = { textAreaStyle: { width:'700' }, buttonFatherStyle:{ display:'flex', display:"-webkit-flex", flexWrap: 'wrap', justifyContent:'around',
flex display
来分隔两个按钮
现在,我正在使用react
const style = {
textAreaStyle: {
width:'700'
},
buttonFatherStyle:{
display:'flex',
display:"-webkit-flex",
flexWrap: 'wrap',
justifyContent:'around',
backgroundColor:'red',
}
}
myjsx
:
<div style={style.buttonFatherStyle}>
<FlatButton style={{backgroundColor:'blue'}} type="submit" disabled={pristine || submitting}> submit </FlatButton>
<FlatButton style={{backgroundColor:'green'}} type="button" disabled={pristine || submitting} onClick={reset}> Clear
</FlatButton>
</div>
提交
清楚的
我的代码不起作用 试试这段代码
flatbutton {
flex-basis: 50%;
text-align: center;
}
作为文件:
facebook.github.io/react-native/docs/flexbox.html
你应该试试:
justifyContent: 'space-between'
你也可以玩marginRight和marginLeft。
希望能得到帮助你是否尝试证明内容的合理性:“间距”?你可以在这里阅读有关flex布局的所有信息:并且你可以使用太多的“边距”适当性(例如:marginLeft:20,marginRight:20)它也可以起作用
证明内容的合理性:“间距”
或间距”
,你能把我的答案标记为验证吗?:)很高兴它帮助了你