![](/img/trans.png)
[英]Customizing bootstrap - how to change the number of columns under a certain width?
[英]How to change column width based on the number of columns present?
以下面的reactstrap示例為例:
<Container fluid>
<Row>
<Col md={4}>
<TodoAdd />
</Col>
<Col md={8}>
<TodoList />
</Col>
</Row>
</Container>
有時,第二列不在DOM中。 發生這種情況時,我希望第一列的'md'屬性為{12}。
換一種說法,我希望列保持流暢,即當不存在同級列時占用行的整個寬度。
您可以這樣做:
<Container fluid>
<Row>
<Col>
<TodoAdd />
</Col>
<Col md={8}>
<TodoList />
</Col>
</Row>
</Container>
第一列將占用其他提到的大小(通過md,sm等)剩下的列所占用的空間。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.