Index
记录 bootstrap 的一些知识
Grid
Grid options
垂直对齐: align-items-center, align-items-start,align-items-end
单独设置某个列的对齐方式:align-self-start,align-self-center, align-self-end
|
|
水平对齐: justify-content-start, justify-content-center,justify-content-end,justify-content-around,justify-content-between(对齐到两边,中间为空)
|
|
Extra small <576px | Small ≥576px | Medium ≥768px | Large ≥992px | Extra large ≥1200px | |
---|---|---|---|---|---|
Max container width | None (auto) | 540px | 720px | 960px | 1140px |
Class prefix | .col- |
.col-sm- |
.col-md- |
.col-lg- |
.col-xl- |
# of columns | 12 | ||||
Gutter width(.no-gutters) | 30px (15px on each side of a column) | ||||
Nestable(可嵌套) | Yes | ||||
Column ordering | Yes |
col-md-auto 根据内容自动调整宽度
每行两列,row-cols 快速设置
|
|
强制换行
|
|
使用.order-
类来控制内容的视觉顺序
|
|
偏移列
|
|
尺寸 Size
w-25 : 25%宽度
h-25:25%的高度
mw-100: max-width: 100%
mh-100:max-height: 100%
相对于视口 viewport 的尺寸
min-vw-100 min-width 100vw
min-vh-100 min-height 100vh
vm-100 width 100vw
vh-100 height 100vh
间隔 Spacing
mx-auto 水平居中
margin padding
m
- for classes that setmargin
p
- for classes that setpadding
Where sides is one of:
t
- for classes that setmargin-top
orpadding-top
b
- for classes that setmargin-bottom
orpadding-bottom
l
- for classes that setmargin-left
orpadding-left
r
- for classes that setmargin-right
orpadding-right
x
- for classes that set both*-left
and*-right
y
- for classes that set both*-top
and*-bottom
- blank - for classes that set a
margin
orpadding
on all 4 sides of the element
Where size is one of:
0
- for classes that eliminate themargin
orpadding
by setting it to0
1
- (by default) for classes that set themargin
orpadding
to$spacer * .25
2
- (by default) for classes that set themargin
orpadding
to$spacer * .5
3
- (by default) for classes that set themargin
orpadding
to$spacer
4
- (by default) for classes that set themargin
orpadding
to$spacer * 1.5
5
- (by default) for classes that set themargin
orpadding
to$spacer * 3
auto
- for classes that set themargin
to auto
Text
text-wrap 让文字换行
text-justify 对齐到组件
text-left, text-center, text-right
text-nowrap 防止文字换行
text-truncate 将文本截断并添加省略号,必须是 display: inline-block 或 display: bolck 类型
text-lowercase, uppercase, capitalize 首字母大写
text-reset 重置文本或链接的颜色,以便从父元素继承颜色属性
text-decoration-none 去除文字的装饰, 不带下换线的链接
Visibility
仍然占据页面空间
.visible
.invisible