bootstrap弹性盒子
时间: 2024-01-02 14:04:56 浏览: 137
(小程序)弹性布局盒子
以下是关于Bootstrap弹性盒子的介绍和示例:
1. 弹性子元素等宽:
```html
<div class="container mt-3">
<h2>等宽</h2>
<p>.flex-fill 用于设置子元素等宽:</p>
<div class="d-flex">
<div class="p-2 bg-info flex-fill">111111111111111111</div>
<div class="p-2 bg-warning flex-fill">Flex item 2</div>
<div class="p-2 bg-primary flex-fill">Flex item 3</div>
</div>
</div>
```
2. 弹性子元素排序:
```html
<div class="container mt-3">
<h2>排序</h2>
<p>.order 类可以设置弹性子元素的排序,从 .order-1 到 .order-12,数字越低权重越高:</p>
<div class="d-flex mb-3">
<div class="p-2 order-3 bg-info">Flex item 1</div>
<div class="p-2 order-2 bg-warning">Flex item 2</div>
<div class="p-2 order-1 bg-primary">Flex item 3</div>
</div>
</div>
```
阅读全文