我需要将col内容水平对齐到中心。我看了ant文档,但找不出解决方案。我尝试的是:
的数据
egdjgwm81#
我通过向Col组件添加“type”和“align”属性来解决问题。
<Row> <Col span={8} style={{backgroundColor:'red'}} type="flex" align="middle" > Col </Col> <Col span={4} style={{backgroundColor:'blue'}}> Col </Col> </Row>
字符串
d5vmydt92#
我通过将CSS属性“justifyContent:center”添加到col组件来解决这个问题。
<Row> <Col style={{display: 'flex', justifyContent: 'end'}}></Col> <Col style={{display: 'flex', justifyContent: 'center'}}></Col> </Row>
2条答案
按热度按时间egdjgwm81#
我通过向Col组件添加“type”和“align”属性来解决问题。
字符串
d5vmydt92#
我通过将CSS属性“justifyContent:center”添加到col组件来解决这个问题。
字符串