CSS: series of floated elements without wrapping but rather scrolling horizontally

后端 未结 10 1615
无人及你
无人及你 2021-02-01 04:25

I\'m working on a album viewer. At the top I want a horizontal container of all the image thumbnails. Right now all the thumbnails are wrapped in a div with float:left

10条回答
  •  再見小時候
    2021-02-01 04:52

    This is driving me nuts, can't figure it out.

    This kinda works:

    .thumbnail {
        padding-right:4px;
        width:100px; height:75px;
        display: table-cell;
    }
    .thumbnail img {
        border:1px solid black;
        display: block;
        width:100px; height:75px;
    }
    

    But I have no idea about browser support for display: table-cell;

    Personally i would either make the thumbs vertical or use javascript (the browser scrollbar is ugly anyways)

提交回复
热议问题