简体   繁体   English

现代的图片库:流畅还是弹性?

[英]A modern image gallery: fluid or elastic?

cross posted (as suggested) from ux.stackexchange 从ux.stackexchange交叉发布(根据建议)

I am new to UX and IA and everything about interface and solution design. 我是UX和IA以及有关界面和解决方案设计的一切的新手。 I need to do a simple image gallery based on grids. 我需要做一个基于网格的简单图片库。 I read about responsive design and media queries. 我读了有关响应式设计和媒体查询的文章。

Ok, in wide screen i have 7 columns grid, in laptop 5 columns, in tablet 3 and in smarthpone 1. This is pretty cool. 好的,在宽屏中,我有7列网格,在笔记本电脑中有5列,在平板电脑3中和在smarthpone 1中。这非常酷。 I have done this with fluid layouts, using percentage for the width property. 我已经完成了流畅的布局,使用百分比作为width属性。 And I like this solution because it is flexible to all viewport size. 我喜欢这种解决方案,因为它可以适应所有视口大小。

But what about if a user change font size with "command +" or "command -" keys? 但是,如果用户使用“命令+”或“命令-”键更改字体大小怎么办? If image width are with percentage the container size does not change, and images does not change either. 如果图像宽度为百分比,则容器大小不会更改,图像也不会更改。 The result is a little bit weird: everything is getting smaller but images does not changes (well, the margin changes, that is even weirder). 结果有点不可思议:所有内容都变小了,但图像没有变化(嗯,边距变化了,甚至更奇怪了)。

But if I use em for width I obtain a no more fluid layout. 但是,如果将em用作宽度,则不会获得更流畅的布局。

How mix the two layouts? 如何混合两种布局?

I personally like to setup 2 separate css stylesheets. 我个人喜欢设置2个单独的CSS样式表。 One for the main site (desktop version), then the other for mobile devices. 一个用于主站点(台式机版本),另一个用于移动设备。

So in a stylesheet called responsive.css you can have something like this: 因此,在名为sensitive.css的样式表中,您可以具有以下内容:

 @media only screen and (min-width: 768px) and (max-width: 1024px)
 {
   /*stuff in here*/
 }

And you can adjust the widths as you wish or add more if necessary. 并且您可以根据需要调整宽度,或者在必要时添加更多宽度。

I personally dislike responsive design and enjoy more fluid designs. 我个人不喜欢响应式设计,喜欢更流畅的设计。 There are so many different size mobile devices that using a fluid design may work better overall for what you are trying to achieve. 有许多不同大小的移动设备,因此使用流畅的设计可能会总体上更好地实现您要实现的目标。

As for font size, try to always use em since it re-sizes more accurately. 至于字体大小,请尝试始终使用em,因为它会更精确地调整大小。

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

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