04-辅助类

nobility 发布于 2021-10-20 2023 次阅读


辅助类

浮动类

类名 描述
.float-left 当前元素左浮动
.float-right 当前元素右浮动
.float-none 当前元素不浮动
.clearfix 父元素添加,清除浮动

文本类

类名 描述
.text-left 左对齐
.text-center 居中对齐
.text-right 右对齐
.text-justify 两端对齐
.text-truncate 文本溢出截断为省略号
.text-lowercase 文本转小写
.text-uppercase 文本转大写
.text-capitalize 文本转首字母大写

颜色

  • 背景颜色使用bg前缀
  • 前景颜色使用text前缀
  • 边框颜色使用border前缀
  • 按钮使用btn前缀(Bootstrap4还增加了.btn-outline-*轮廓按钮)
颜色 描述
primary 主色
secondary 辅色
success 成功色
danger 危险色
warning 警告色
info 信息色
dark 黑暗色,仅Bootstrap4支持
light 光明色,仅Bootstrap4支持

Bootstrap4新增功能

阴影

类名 描述
.shadow-none 无阴影
.shadow-sm 小阴影
.shadow 有阴影
shadow-lg 大阴影

边框

类名 描述
.border.border-方向 添加边框
.border-0.border-方向-0 消减边框
.rounded.rounded-方向 圆角边框
.rounded-0 消除圆角
.rounded-lg 大圆角
.rounded-sm 小圆角
.rounded-circle 圆形边框
.rounded-pill 胶囊边框
此作者没有提供个人介绍
最后更新于 2021-10-20