横向超越转动,隐蔽转动条,可滑动

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        body{
            padding: 0;
            margin: 0;
        }
        .box{
            width: 100%;
            height: 300px;
            background-color: #00aaee;
        }
        .box .box-item{
            display: flex;
            flex-wrap: nowrap;
            align-items: center;

            /* width:200px; */
            width: 100%;
            height: 50px;

            overflow-x: scroll;
            overflow-y: hidden; 
            /* overflow: auto; */
            white-space: nowrap;
            background-color: #ff0000;
        }
        .box .box-item .item-group{
            /* float: left; */
            flex: 0 0 100px;
            width: 100px;
            text-align: center;
            box-sizing: border-box;
            border-right: 1px solid #ccc;
        }
        ::-webkit-scrollbar {
            display: none
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="box-item">
                <div class="item-group">1</div>
                <div class="item-group">2</div>
                <div class="item-group">3</div>
                <div class="item-group">4</div>
                <div class="item-group">5</div>
                <div class="item-group">6</div>
                <div class="item-group">7</div>
                <div class="item-group">8</div>
                <div class="item-group">9</div>
                <div class="item-group">10</div>
                <div class="item-group">11</div>
                <div class="item-group">12</div>
        </div>
    </div>
</body>
</html>
    原文作者:渣渣辉
    原文地址: https://segmentfault.com/a/1190000013319112
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞