Image gallery
历史经典摄影网站:Ansel Adams Gallery, Magnum Photos #生活知识# #摄影技巧# #摄影学习网站#
This question shows research effort; it is useful and clear
0
Save this question.
Show activity on this post.
I'm working on a dynamic php gallery. The thumbnails will all have the same width but various heights. They'll be placed from left to right. So, I don't want to use a five columns pattern. I guess it's not possible to do it only with CSS, so maybe you know any jquery script that would do the job? I guess this kind of gallery pattern is quite common...
https://i.sstatic.net/Xwdx0.png
m59
43.9k14 gold badges122 silver badges139 bronze badges
asked Nov 21, 2013 at 19:48
1
This answer is useful
1
Save this answer.
Show activity on this post.
Here's the pure css solution using css3 columns. This isn't going to work in older browsers, read here (click). Live demo here (click).
You can use masonry.js, isotope.js, or packery.js for more compatible js solutions.
<div class="col-5"> <div class="sm"></div> <div class="lg"></div> <div class="sm"></div> <div class="sm"></div> <div class="lg"></div> <div class="lg"></div> <div class="sm"></div> <div class="lg"></div> <div class="lg"></div> <div class="lg"></div> </div>
css:
.col-5 { -webkit-column-count: 5; -moz-column-count: 5; column-count: 5; } .col-5 > div { display: inline-block; } .sm { height: 75px; } .lg { height: 125px; }
answered Nov 21, 2013 at 20:30
m59m59
43.9k14 gold badges122 silver badges139 bronze badges
This answer is useful
0
Save this answer.
Show activity on this post.
answered Nov 21, 2013 at 20:25
A-frameA-frame
3012 gold badges3 silver badges8 bronze badges
0
This answer is useful
0
Save this answer.
Show activity on this post.
If you're trying to make the layout the 'pintrest' way, you can have an array of x columns and iterate through each column to check for the shortest height, and add the next box in that column.
That way you would know it works for all browsers [unless they have js disabled] and then you can style the width of the columns.
answered Nov 21, 2013 at 20:34
C. S.C. S.
8217 silver badges7 bronze badges
Start asking to get answers
Find the answer to your question by asking.
Ask question
Explore related questions
See similar questions with these tags.
网址:Image gallery https://klqsh.com/news/view/132816
相关内容
My copilot says I reached the “daily limit” after one (1) image.How do I turn off the option “Related Content from the Web” whenever I prompt an image in Bing?
QM Model
Hotels in Lancashire
Celebrate Black History Month in Seattle with New Restaurants, Tasting Rooms, and Exhibit Openings
Seattle Events Calendar: Find Things To Do
Color Picker
时隔4个多月首次亮相!小S低调现身二女儿画展!艺人朋友都去支持
大学同窗好友做的公众号 —— 励志鸡汤号 —— 知识补给站 —— "认知无穷大"
Python 3.14 下载安装教程,一步安装到位,新手也能变编程大师
随便看看
- 家风故事|外婆的豆腐菜
- 潼潼在成长:“1小时家教费=普通人3年工资|教育分层的刀早就架在脖子上了” 凌晨五点,衡水中学的路灯照着第38套黄冈密卷;同一时刻,北京顺义别墅里,14岁少女刚结束诺奖得主的私教课——学费1.2万/小时,抵得上县城家庭三个月收入。 扎心真相: 富人育儿玩的是“认知世袭”:6岁学商业案例,12岁操作虚拟股票,大学直接继承家族办公室 穷孩子困在“刷题地狱”:三年写空142支笔芯...
- 扬帆逐梦,奔赴山海 ——致合肥工业大学2025届毕业生的一封信
- 智领创业说: 65集丨人生指南,三十多年,四条智慧,一生受用 #人生智慧#职场发展#人际关系#财富管理
- 短剧《人生升级指南》高清无删减在线观看

