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

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

    I had the same problem a few months ago. I tried all solutions presented here. They don't work.

    This is my solution:

    Give the wrapper div the needed width fix (body will expand, too). Then put the content in the extra large wrapper container (float or inline). Now you can use the horizontal scrollbar of the window as scrollbar. Now everything else on the page (header, footer etc.) is scrolling with. You can give these containers position:fixed. Now they stay on there position, while you are scrolling the extra wide wrapper/body.

提交回复
热议问题