简体   繁体   English

仅显示图库的5张缩略图

[英]show only 5 thumbnails pictures of a gallery

I am looking for a solution to show only the first 5 thumbnails pictures of a gallery. 我正在寻找一种仅显示画廊的前5张缩略图的解决方案。

Right now I have a big picture and beneath it all pictures as thumbnails. 现在,我有一张大图片,所有图片下面都显示为缩略图。 Clicking on the thumbnail will open a popup gallery slideshow. 单击缩略图将打开一个弹出库幻灯片放映。

I want to limit the visible thumbnail pictures on the page to max 5 and hide the others. 我想将页面上的可见缩略图图片限制为最多5张,并隐藏其他图片。

Does anybody know a way to accomplish this? 有人知道实现此目标的方法吗?

You should provide some of your code so we can help you the best. 您应该提供一些代码,以便我们为您提供最好的帮助。 but the simple way to do it by: overflow: hidden; :但简单的方法来通过做overflow: hidden; with specific width example: 具体width示例:

.thumbnails
{
    width: 200px;
    overflow: hidden;
    display: block;
}

.thumbnail 
{
    width: 40px;
    display: inline-block;
}

elements with class .thumbnails will hold the images and each image will have a class of .thumbnail .thumbnails类的.thumbnails将保存图像,每个图像将具有一类.thumbnail

DEMO: https://jsfiddle.net/277tdp0y/1/ 演示: https : //jsfiddle.net/277tdp0y/1/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM