<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1{
            width: 100px;
            height: 100px;
            background: red;
            /* 设置元素溢出需要来父标签的选择器上设置 */
            /* 设置超出部分隐藏 */
            /* overflow: hidden; */
            /* 默认超出部分显示 */
            /* overflow: visible; */
            /* 超出部分滚动显示 */
            overflow: auto;
        }
        .box2{
            width: 200px;
            height: 50px;
            background: green;
        }
    </style>
</head>
<body>
    <div class="box1">
        <div class="box2">哈哈哈哈</div>
    </div>
</body>
</html>