- 引导布局
 - Bootstrap - 断点
 - Bootstrap - 容器
 - Bootstrap - 网格系统
 - Bootstrap - 列
 - Bootstrap - 排水沟
 - Bootstrap - 实用程序
 - Bootstrap - Z 索引
 - Bootstrap - CSS 网格
 
- 引导组件
 - Bootstrap - 手风琴
 - Bootstrap - 警报
 - Bootstrap - 徽章
 - Bootstrap - 面包屑导航
 - Bootstrap - 按钮
 - Bootstrap - 按钮组
 - Bootstrap - 卡片
 - Bootstrap - 轮播
 - Bootstrap - 关闭按钮
 - Bootstrap - 折叠
 - Bootstrap - 下拉菜单
 - Bootstrap - 列表组
 - Bootstrap - 模态
 - Bootstrap - 导航栏
 - Bootstrap - 导航和选项卡
 - Bootstrap - Offcanvas
 - Bootstrap - 分页
 - Bootstrap - 占位符
 - Bootstrap - 弹出窗口
 - Bootstrap - 进展
 - Bootstrap-Scrollspy
 - Bootstrap - 旋转器
 - Bootstrap - 吐司
 - Bootstrap - 工具提示
 
- 引导表单
 - Bootstrap - 表单
 - Bootstrap - 表单控制
 - 引导程序 - 选择
 - Bootstrap - 支票和收音机
 - Bootstrap - 范围
 - Bootstrap - 输入组
 - Bootstrap - 浮动标签
 - Bootstrap - 布局
 - 引导程序 - 验证
 
- 引导助手
 - Bootstrap-Clearfix
 - Bootstrap - 颜色和背景
 - Bootstrap - 彩色链接
 - Bootstrap - 聚焦环
 - Bootstrap - 图标链接
 - Bootstrap - 位置
 - Bootstrap - 比率
 - Bootstrap - 堆栈
 - Bootstrap - 拉伸链接
 - Bootstrap - 文本截断
 - Bootstrap - 垂直规则
 - Bootstrap - 视觉隐藏
 
- 引导实用程序
 - Bootstrap - 背景
 - Bootstrap - 边框
 - Bootstrap - 颜色
 - Bootstrap - 显示
 - Bootstrap-Flex
 - Bootstrap - 浮动
 - Bootstrap - 交互
 - 引导程序 - 链接
 - Bootstrap - 对象拟合
 - Bootstrap - 不透明度
 - Bootstrap - 溢出
 - Bootstrap - 位置
 - Bootstrap - 阴影
 - Bootstrap - 尺寸调整
 - Bootstrap - 间距
 - Bootstrap - 文本
 - Bootstrap - 垂直对齐
 - Bootstrap - 可见性
 
- 引导演示
 - Bootstrap - 网格演示
 - Bootstrap - 按钮演示
 - Bootstrap - 导航演示
 - Bootstrap - 博客演示
 - Bootstrap - 滑块演示
 - Bootstrap - 轮播演示
 - Bootstrap - 标头演示
 - Bootstrap - 页脚演示
 - Bootstrap - 英雄演示
 - Bootstrap - 特色演示
 - Bootstrap - 侧边栏演示
 - Bootstrap - 下拉菜单演示
 - Bootstrap - 列表组演示
 - Bootstrap - 模态演示
 - Bootstrap - 徽章演示
 - Bootstrap - 面包屑演示
 - Bootstrap - Jumbotrons 演示
 - Bootstrap-粘性页脚演示
 - Bootstrap-相册演示
 - Bootstrap-登录演示
 - Bootstrap 定价演示
 - Bootstrap-Checkout 演示
 - Bootstrap-产品演示
 - Bootstrap-封面演示
 - Bootstrap-仪表板演示
 - Bootstrap-粘性页脚导航栏演示
 - Bootstrap-Masonry 演示
 - Bootstrap-Starter 模板演示
 - Bootstrap-Album RTL 演示
 - Bootstrap-Checkout RTL 演示
 - Bootstrap-Carousel RTL 演示
 - Bootstrap-博客 RTL 演示
 - Bootstrap-仪表板 RTL 演示
 
- Bootstrap 有用资源
 - Bootstrap - 问题与解答
 - Bootstrap - 快速指南
 - Bootstrap - 有用的资源
 - Bootstrap - 讨论
 
Bootstrap - 溢出
本章讨论 Bootstrap 的溢出实用程序。溢出实用程序类用于控制元素内溢出内容的Behave。
Bootstrap提供了几个与溢出相关的实用程序类。默认情况下,这些类不响应。
| 班级 | 描述 | 
|---|---|
| .overflow-auto | 如果内容超出元素的尺寸,则会自动将滚动条添加到元素。 | 
| .溢出隐藏 | 当内容超过元素的尺寸时隐藏内容。 | 
| .溢出滚动 | 无论内容是否超出元素的尺寸,都会向元素添加滚动条。 | 
| .overflow-可见 | 允许内容溢出元素的尺寸,而无需剪切或滚动。 | 
让我们看一个例子:
例子
您可以使用“编辑并运行”选项编辑并尝试运行此代码。
<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap - Overflow</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>
  </head>
  <body>
    <div class="container p-3">
    <h4 class="text-start text-primary">
      Overflow utility example</h4>
    <div class="overflow-auto mt-3 pb-5 bg-light" 
     style="max-width: 360px; max-height: 80px;">
         <code>.overflow-auto</code> is a class applied 
        on an element with set width and height dimensions. 
          By design, this content will vertically scroll, if overflowing.
    </div>
    <div class="overflow-hidden mt-5 pb-5 bg-light" 
         style="max-width: 360px; max-height: 80px;">
         <code>.overflow-hidden</code> is a utility class that is applied
          on an element with set width and height dimensions. This will hide the contents, when overflowing.
    </div>
    <div class="overflow-visible mt-5 pb-5 bg-light" 
         style="max-width: 360px; max-height: 80px;">
         <code>.overflow-visible</code> is a utility class that is applied
          on an element with set width and height dimensions. This will not hide the contents, when overflowing.
    </div>
    <div class="overflow-scroll mt-5 pb-5 bg-light" 
         style="max-width: 360px; max-height: 80px;">
         <code>.overflow-scroll</code> is a utility class that is applied
          on an element with set width and height dimensions. This will always show a scroll bar irrespective of whether the content will overflow or not.
    </div>
    <div class="overflow-scroll mt-5 pb-5 bg-light" 
         style="max-width: 360px; max-height: 80px;">
         <code>.overflow-scroll</code> is a utility class that shows a scroll bar always.
    </div>
    </div>
  </body>
</html>
溢出-x
Overflow -x属性用于控制元素的水平溢出Behave。它确定当元素内的内容超出其水平轴宽度时会发生什么。
Overflow -x属性可以具有以下值:
| 班级 | 描述 | 
|---|---|
| .overflow-x-auto | 如果内容超出元素的宽度,则会自动向元素添加水平滚动条。 | 
| .overflow-x-隐藏 | 当内容超出元素沿水平轴的宽度时隐藏内容。 | 
| .overflow-x-滚动 | 无论内容是否超过元素的宽度,都会向元素添加水平滚动条。 | 
| .overflow-x-可见 | 允许内容沿水平轴溢出元素的尺寸,而无需剪切或滚动。 | 
让我们看一个例子:
例子
您可以使用“编辑并运行”选项编辑并尝试运行此代码。
<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap - Overflow</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>
  </head>
  <body>
    <div class="container p-3">
        <h4>Overflow-x-* Example</h4>
        <div class="overflow-x-auto mt-3 pb-5"
        style="max-width: 340px; max-height: 90px;">
        <code>.overflow-x-auto</code> allows the users to scroll horizontally and view the overflowed content.
        </div>
        <div class="overflow-x-hidden mt-5 pb-5"
        style="max-width: 340px; max-height: 85px;">
        <code>.overflow-x-hidden</code> is a class applied 
        on an element with set width and height dimensions. 
        This will hide the contents, when overflowing, along the x-axis.
        </div>
        <div class="overflow-x-visible mt-5 pb-5"
        style="max-width: 340px; max-height: 80px;">
        <code>.overflow-x-visible</code> is a class applied 
        on an element with set width and height dimensions. 
        This will not hide the contents, even when overflowing, along the x-axis.
        </div>
        <div class="overflow-x-scroll mt-5 pb-5"
        style="max-width: 340px; max-height: 120px;">
        <code>.overflow-x-scroll</code> 
        This ensures that a horizontal scrollbar is always present, even if there is no actual overflow along the horizontal axis.
        </div>
    </div>
  </body>
</html>
溢出-y
Overflow -y属性用于控制元素的垂直溢出Behave。它确定当元素内的内容超过其垂直轴高度时会发生什么。
Overflow -y属性可以具有以下值:
| 班级 | 描述 | 
|---|---|
| .overflow-y-auto | 如果内容超出元素的高度,则会自动向元素添加垂直滚动条。 | 
| .overflow-y-隐藏 | 当内容沿垂直轴超过元素高度时隐藏内容。 | 
| .overflow-y-scroll | 无论内容是否超过元素的高度,都会向元素添加垂直滚动条。 | 
| .overflow-y-visible | 允许内容沿垂直轴溢出元素的尺寸,而无需剪切或滚动。 | 
让我们看一个例子:
例子
您可以使用“编辑并运行”选项编辑并尝试运行此代码。
<!DOCTYPE html>
<html>
  <head>
    <title>Bootstrap - Overflow</title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js"></script>
  </head>
  <body>
    <div class="container mt-3">
        <h4>Overflow-y-* Example</h4>
        <div class="overflow-y-auto mt-3 pb-5"
        style="max-width: 340px; max-height: 80px;">
        <code>.overflow-y-auto</code> allows the users to scroll vertically and view the overflowed content. 
        In order to adjust the content, a vertical scroll bar should appear.
        </div>
        <div class="overflow-y-hidden mt-5 pb-5"
        style="max-width: 340px; max-height: 80px;">
        <code>.overflow-y-hidden</code> is a class applied 
        on an element with set width and height dimensions. 
        This will hide the contents, when overflowing, along the y-axis.
        </div>
        <div class="overflow-y-visible mt-5 pb-5"
        style="max-width: 340px; max-height: 70px;">
        <code>.overflow-y-visible</code> is a class applied 
        on an element with set width and height dimensions. 
        This will not hide the contents, even when overflowing, along the y-axis.
        </div>
        <div class="overflow-y-scroll mt-5"
        style="max-width: 340px; max-height: 80px;">
        <code>.overflow-y-scroll</code> 
        This ensures that a vertical scrollbar is always present, even if there is no actual overflow along the vertical axis.
        </div>
    </div>
  </body>
</html>