search

Home  >  Q&A  >  body text

css - 多个div显示横向滚动条


类似这种条目多的话显示横向滚动条怎么实现

巴扎黑巴扎黑2822 days ago1314

reply all(3)I'll reply

  • 阿神

    阿神2017-04-17 15:05:32

    This...

    Come and look at the code; communicate at any time:

    HTML:

        <p>
            <ul>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
            </ul>
        </p>
        
        
        

    CSS:

        p{
            width: 996px;
            height: 120px;
            overflow-x:auto;
            overflow-y:hidden;  
        }
        ul{
            width: 1990px;
        }
        li{
            width: 220px;
            height: 300px;
            margin: 10px;
            float: left;
            background: red;
        }

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 15:05:32

    ul li writes and then li float, display block

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 15:05:32

    In the same building, put another p on the outer layer, and set the overflow-x of the outer p: auto

    reply
    0
  • Cancelreply