您将如何编写针对多种屏幕尺寸的媒体查询? [英] How would you write media queries for multiple screen sizes?

查看:59
本文介绍了您将如何编写针对多种屏幕尺寸的媒体查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我想要

body {font-size:18 px} 1900及更高版本

body {font-size:18 px} for 1900 and above

body {font-size:16 px} for 1024 and 1900

body {font-size:16 px} for 1024 and 1900

body {font-size:14 px} for 768 to 1023

body {font-size:14 px} for 768 to 1023

body {font-size:12 px} 为320至767

body {font-size:11 px} 为0到320

我刚刚举了一个例子,并提出了疑问.

I just given and example for question.

推荐答案

这应该可以完成

@media only screen and (min-width: 320px)  { body{ font-size: 12px; } }
@media only screen and (min-width: 768px)  { body{ font-size: 14px; } }
@media only screen and (min-width: 1024px) { body{ font-size: 16px; } }
@media only screen and (min-width: 1900px) { body{ font-size: 18px; } }

这篇关于您将如何编写针对多种屏幕尺寸的媒体查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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