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

后端 未结 10 1614
无人及你
无人及你 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:45

    I would still prefer to be able to use block elements for the thumbnails tho so I can add borders and what not.

    You can use "borders and whatnot" with display: inline-block elements. You can also use fixed with/height inline-block elements, so that your design is consistent.

    Basically, make .thumbnail not-floated and display: inline-block, apply width/height, borders etc., and on #thumbnails_container use white-space: nowrap.

提交回复
热议问题