The height of the front-end DIV is only 100px, and the width is only 100px. I want to put a DIV with a width of 200 in this DIV, and pull the scroll bar left and right to display

 

<!DOCTYPE html>
<html>
<head>
    <title>点击监听两组span标签</title>
    <style>
        .outer-div {
            width: 100px;
            height: 100px;
            overflow-x: scroll;
            background-color: #abc1ee;
        }

        .inner-div {
            width: 200px;
        }

        /* 自定义滚动条样式 */
        .outer-div::-webkit-scrollbar {
            width: 6px; /* 滚动条宽度 */
        }

        .outer-div::-webkit-scrollbar-thumb {
            background-color: #888; /* 滚动条滑块颜色 */
        }

        .outer-div::-webkit-scrollbar-thumb:hover {
            background-color: #555; /* 滚动条滑块悬停颜色 */
        }
    </style>
</head>
<body>
<div class="outer-div">
    <div class="inner-div">
        <!-- 在这里添加你想要显示的内容 -->
        在这里添加你想要显示的内容
    </div>
</div>
</body>
</html>

Guess you like

Origin blog.csdn.net/Ghjkku/article/details/131720668