官方文档地址
https://getbootstrap.com/docs/4.4/utilities/overflow/
其他文档地址
- http://bs4.vx.link
- https://v4.bootcss.com
overflow-auto
.overflow-auto
<div class="container">
<div class="bg-success overflow-auto" style="height: 100px; width: 100px;">
<span>
This is an example of using .overflow-auto on an element with
set width and height dimensions.
By design, this content will vertically scroll.
这是在具有设置宽度和高度尺寸的元素上使用 .overflow-auto 的示例。
此内容将垂直滚动。
</span>
</div>
</div>
overflow-hidden
.overflow-hidden
<div class="container">
<div class="bg-warning overflow-hidden" style="height: 100px; width: 100px;">
<span>
This is an example of using .overflow-auto on an element with
set width and height dimensions.
By design, this content will vertically scroll.
这是在具有设置宽度和高度尺寸的元素上使用 .overflow-auto 的示例。
此内容将垂直滚动。
</span>
</div>
</div>
整体代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"/>
<title>06内容溢出</title>
<!--<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">-->
<!-- 新 Bootstrap4 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<div class="bg-success overflow-auto" style="height: 100px; width: 100px;">
<span>
This is an example of using .overflow-auto on an element with
set width and height dimensions.
By design, this content will vertically scroll.
这是在具有设置宽度和高度尺寸的元素上使用 .overflow-auto 的示例。
此内容将垂直滚动。
</span>
</div>
</div>
<hr />
<div class="container">
<div class="bg-warning overflow-hidden" style="height: 100px; width: 100px;">
<span>
This is an example of using .overflow-auto on an element with
set width and height dimensions.
By design, this content will vertically scroll.
这是在具有设置宽度和高度尺寸的元素上使用 .overflow-auto 的示例。
此内容将垂直滚动。
</span>
</div>
</div>
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
<!-- bootstrap.bundle.min.js 用于弹窗、提示、下拉菜单,包含了 popper.min.js -->
<script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
<!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
<script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
</body>
</html>