手册
目录
| XSmall | Small | Medium | Large | Extra Large | XXL | |
|---|---|---|---|---|---|---|
| 类前缀 | .col- |
.col-sm- |
.col-md- |
.col-lg- |
.col-xl- |
.col-xxl- |
| 屏幕宽度 | <576px | >=576px | >=768px | >=992px | >=1200px | >=1400px |
XXL 设备被定义为具有 1400 像素及以上的屏幕宽度。
下例将在中型、大型和超大型设备上产生 50%/50% 的拆分,在 XXL 设备上产生 25%/75% 的拆分。在小型和超小型设备上,它会自动堆叠(100%):
<div class="container-fluid">
<div class="row">
<div class="col-md-6 col-xxl-3">
<p>世界自然基金会(WWF),成立于1961年4月29日,其标志是一只大熊猫 ...</p>
</div>
<div class="col-md-6 col-xxl-9">
<p>1980年,WWF正式来到中国,受中国政府邀请来华开展大熊猫及其栖息地的保护工作 ...</p>
</div>
</div>
</div>
注意:请确保总和始终为 12。
在下例中,我们只指定了 .col-xxl-6 类(没有 .col-md-* 和 / 或 .col-sm-*)。这意味着 xxlarge 设备将拆分 50%/50%。但是,对于超大、大、中、小和超小设备,它将垂直堆叠(100% 宽度):
<div class="container-fluid">
<div class="row">
<div class="col-xxl-6">
<p>世界自然基金会(WWF),成立于1961年4月29日,其标志是一只大熊猫 ...</p>
</div>
<div class="col-xxl-6">
<p>1980年,WWF正式来到中国,受中国政府邀请来华开展大熊猫及其栖息地的保护工作 ...</p>
</div>
</div>
</div>
在 Bootstrap 5 中,有一种简单的方法可以为所有设备创建等宽的列:只需从 .col-xxl-* 中删除数字,并仅在 col 元素上使用 .col-xxl 类。 Bootstrap 将识别有多少列,并且每列将获得相同的宽度。
如果屏幕尺寸小于 1400px,列将水平堆叠:
<!-- 两列:在特大型以上设备是 50% 宽度 --> <div class="row"> <div class="col-xxl">1 of 2</div> <div class="col-xxl">2 of 2</div> </div> <!-- 四列:在特大型以上设备是 25% 宽度 --> <div class="row"> <div class="col-xxl">1 of 4</div> <div class="col-xxl">2 of 4</div> <div class="col-xxl">3 of 4</div> <div class="col-xxl">4 of 4</div> </div>
相关
视频
RELATED VIDEOS
科技资讯
1
2
3
4
5
6
7
8
9
精选课程
共5课时
17.3万人学习
共49课时
77.4万人学习
共29课时
62万人学习
共25课时
39.5万人学习
共43课时
71.3万人学习
共25课时
61.9万人学习
共22课时
23.1万人学习
共28课时
34.1万人学习
共89课时
125.8万人学习