移動端純css超出盒子出現橫向滾動條


<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        ul {
            list-style: none;
            width:300px;
            margin:100px auto;
            height:100px;
            display: -webkit-box;
            white-space: nowrap;
            overflow: hidden;
            -webkit-backface-visibility: hidden;
            -webkit-perspective: 1000;
            -webkit-overflow-scrolling: touch;
            text-align: justify;
            overflow-x: initial;
        }
        li {
            width:100px;
            height:100px;
            line-height: 100px;
            text-align: center;
            background-color: #1b961b;
            border:1px solid;
        }
        @media only screen and (max-width: 768px){
            ul {
                width:100%;
            }
        }
    </style>
</head>
<body>
    <div class="wrap">
        <ul>
            <li>1</li>
            <li>2</li>
            <li>3</li>
            <li>4</li>
            <li>5</li>
            <li>6</li>
            <li>7</li>
            <li>8</li>
            <li>9</li>
            <li>0</li>
        </ul>
    </div>
</body>
</html>

  在移動端使用,主要看ul上的屬性


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM