在可滚动分区中显示图像
Displaying images in scrollable div
我有一个图像数组(它们的src-url),我想把它们显示在一行中,就像这样:
[Image1][image2][image3]
如果有很多图像,我希望它们所在的<div>
在x轴上可以滚动,这样图像就仍然在一行中。
这就是我现在拥有的:
<div style="overflow-x:scroll" class="col-md-12">
<span ng-repeat="item in images" >
<a ng-href="{{item.ServerRelativeUrl}}" target="_blank">
<img width="128" ng-src="{{item.ServerRelativeUrl}}" alt="Description">
</a>
</span>
</div>
我确实看到了div上的"滚动",但已褪色。我的图像是这样的:
[Image1][Image2][Image3]
[图像4]
我在这里错过了什么?
开始:http://jsfiddle.net/danhaswings/nndhjp67/
HTML
<div id="slide">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
<img src="http://placehold.it/100x100">
</div>
CSS
#slide {
width: auto;
height: 100px;
overflow-x: scroll;
overflow-y: hidden;
white-space: nowrap;
}
添加white-space: nowrap
:
<div style="overflow-x:scroll; white-space: nowrap" class="col-md-12">
尝试将这些CSS规则添加到包装div
中。
overflow-x: scroll;
overflow-y: hidden;
width:100%;
相关文章:
- 从桌面读取python文件时高亮显示代码
- 使用JS如何动态更改显示的html文件中的文本背景颜色
- 如何在生成下载文件时显示加载动画
- React重新渲染但未显示正确的组件
- nodejs-expressjs上传图像并显示它们
- 使用JSP从服务器检索和显示图像
- 音频控件在mouseover上显示,在mouseout上淡出
- 让文本输入幻灯片显示输入时的新文本输入?然后向后滑动
- 使用电话间隙在Android应用程序中显示SQL Lite的数据
- 显示5秒后隐藏潜水
- 画廊图像未显示
- 不显示带有本地json文件数据的谷歌地图脚本
- 如何将json数据显示为html
- 谷歌地图不是以HTML显示,而是在JS Fiddle上工作
- Windows8应用程序(html&Javascript):从图片库(除了文件选择器)显示图像的另一种方式
- 高亮显示时编辑文本大小和颜色
- 有时数据是't显示在浏览器中
- 当鼠标悬停在文本中的单词上时显示警报
- 角度图表;t显示在我的页面中
- 显示图工具提示显示x轴的最后日期值,而不是当前值