【问题标题】:flex box with images in a row带有连续图像的弹性框
【发布时间】:2017-12-03 04:55:36
【问题描述】:
我正在使用引导面板连续显示三个图像。假设如果我总共有六张图片,我想连续显示三张,接下来的三张应该在我移动滚动条时一张一张地出现。
为了应用滚动条,我做了overflow-x:visible,但屏幕上什么也没有。
另外,第四张图片连续排在三张图片的下方。
我应该怎么做才能使图像水平滚动,同时在屏幕上显示三个图像?
我的代码的codepen链接是:Link
【问题讨论】:
标签:
html
css
reactjs
flexbox
bootstrap-4
【解决方案1】:
这是你要找的吗?
.container {
display: flex;
max-width: 225px;
overflow-x: scroll;
}
<div class="container">
<img src="http://placehold.it/75x50/000000">
<img src="http://placehold.it/75x50/ff0000">
<img src="http://placehold.it/75x50/333333">
<img src="http://placehold.it/75x50/00ff00">
<img src="http://placehold.it/75x50/666666">
<img src="http://placehold.it/75x50/0000ff">
</div>