css arrangement of differently sized list items in a neat row

I have a bunch of images which are loaded as a list, some have vertical orientation, some have horizontal, but I want them to appear neatly and left-aligned. This is my CSS code: #designgallery { list-style-type:none; margin-top:15px; float:left; } #designgallery li { display:block; margin:5px; background-color:#eee; padding:5px; float:left; } .design-display { border:1px solid gray; } .Horizontal { width:210px; height:122px; } .Vertical { height:180px; width:122px; } This is my HTML:
  • ... many list items, some horizontal, some vertical
But this is what I get: ![The vertical image on the right-bottom corner should be starting the new line of images on the left side, how do I do that?][1] The vertical image on the right-bottom corner should be starting the new line of images on the left side, how do I do that? [1]: http://i.stack.imgur.com/u7uXN.png
Give Masonry a try.

以上就是css arrangement of differently sized list items in a neat row的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏