Horizontal scroll css?

后端 未结 5 2049
礼貌的吻别
礼貌的吻别 2020-12-23 19:35

I want to have one

with id that has horizontal scroll, but the problem is it has to be responsive, not with fixed width.



        
5条回答
  •  再見小時候
    2020-12-23 20:18

    Just set your width to auto:

    #myWorkContent{
        width: auto;
        height:210px;
        border: 13px solid #bed5cd;
        overflow-x: scroll;
        overflow-y: hidden;
        white-space: nowrap;
    }
    

    This way your div can be as wide as possible, so you can add as many kitty images as possible ;3

    Your div's width will expand based on the child elements it contains.

    jsFiddle

提交回复
热议问题