BootStrap4工具类之内容溢出

官方文档地址

https://getbootstrap.com/docs/4.4/utilities/overflow/

其他文档地址

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>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值