响应式设计与媒体查询:屏幕尺寸? [英] Responsive design with media query : screen size?

查看:139
本文介绍了响应式设计与媒体查询:屏幕尺寸?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用媒体查询处理响应式网站。但我不知道如何采取一个良好的宽度设置。





从这张表上可以看出,即使对于单一类型的设备,也有很多不同的分辨率。随着分辨率在移动设备上变得越来越大,很难知道应用特定分辨率的设计。



现在,我使用的是:



Mobile First



@media屏幕和(min-width:768px)=>平板电脑 / p>

@media屏幕和(min-width:1024px)=>桌面



感谢您的任何建议或建议

解决方案


响应式Web设计(RWD)是一种网页设计方法,最佳观看体验


设计自适应网站时,您应考虑屏幕的大小,而不是设备类型。



如果您要为每个设备设置网站风格,可以使用用户代理 value,但这不是建议,因为你将不得不努力工作,以保持新的设备,新的浏览器,浏览器版本等的代码,而当使用屏幕尺寸时,所有这一切都没有关系。



您可以在此链接中查看一些标准分辨率



但是,在我看来,您应该首先设计您的网站布局,然后才能通过媒体查询适合可能的屏幕尺寸。



为什么?正如我之前说的,屏幕分辨率很大,如果你设计一个移动版本,定位到320px,你的网站将不会优化到350px屏幕或400px屏幕。



TIPS


  1. 设计响应页面时,请在桌面浏览器中打开它,

  2. 使用百分比而不是像素,这将使您的工作更轻松。

示例



我有一个包含5列的表格。当屏幕尺寸大于600像素时,数据看起来不错,所以我在屏幕尺寸较小时添加了一个600像素的断点,并隐藏了1个不太重要的列。具有大屏幕的设备(如桌面设备和平板电脑)将显示所有数据,而具有小屏幕的手机将显示部分数据。






心境



与问题无直接关系,但在回应式设计中却是重要的方面。
响应式设计还涉及用户在使用移动电话或桌面时具有不同的心态的事实。例如,当您在晚上打开银行网站并检查股票时,您希望在屏幕上显示尽可能多的数据。当你在午休时打开同一页时,你可能想看几个重要的细节,而不是去年的所有图表。


I'm working on responsive designed web site using media queries. But i do not know how to take a good width set.

As you can see on this table, there is a lot of different resolution even for a single type of device. And as resolution is coming bigger and bigger on mobile device, it is hard to know what design to apply for a specific resolution.

For now, I'm using this :

Mobile First

@media screen and (min-width:720px) => Phablet

@media screen and (min-width:768px) => Tablet

@media screen and (min-width:1024px) => Desktop

Thank you for any advice or recomendations !

解决方案

Responsive Web design (RWD) is a Web design approach aimed at crafting sites to provide an optimal viewing experience

When you design your responsive website you should consider the size of the screen and not the device type. The media queries helps you do that.

If you want to style your site per device, you can use the user agent value, but this is not recommended since you'll have to work hard to maintain your code for new devices, new browsers, browsers versions etc while when using the screen size, all of this does not matter.

You can see some standard resolutions in this link.

BUT, in my opinion, you should first design your website layout, and only then adjust it with media queries to fit possible screen sizes.

Why? As I said before, the screen resolutions variety is big and if you'll design a mobile version that is targeted to 320px your site won't be optimized to 350px screens or 400px screens.

TIPS

  1. When designing a responsive page, open it in your desktop browser and change the width of the browser to see how the width of the screen affects your layout and style.
  2. Use percentage instead of pixels, it will make your work easier.

Example

I have a table with 5 columns. The data looks good when the screen size is bigger than 600px so I add a breakpoint at 600px and hides 1 less important column when the screen size is smaller. Devices with big screens such as desktops and tablets will display all the data, while mobile phones with small screens will display part of the data.


State of mind

Not directly related to the question but important aspect in responsive design. Responsive design also relate to the fact that the user have a different state of mind when using a mobile phone or a desktop. For example, when you open your bank's site in the evening and check your stocks you want as much data on the screen. When you open the same page in the your lunch break your probably want to see few important details and not all the graphs of last year.

这篇关于响应式设计与媒体查询:屏幕尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆