css媒体查询:目标移动设备,而不指定宽度,像素比率等 [英] css media queries: target mobile devices without specifying width, pixel ratio, etc

查看:137
本文介绍了css媒体查询:目标移动设备,而不指定宽度,像素比率等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我只想指定每个平板电脑和手机,不论大小,是否有媒体查询?是否可以这样做而不指定大小? ://www.w3.org/TR/css3-mediaqueries/> CSS3 spec , @media handeld 被提及,但它可能没有浏览器支持。



不,



但是,您可能会发现这个网站有用,它解释了移动的其他一些媒体查询技术。


Let's say I just want to target every tablet and phone, regardless of size, is there a media query for this? Is it possible to do this without specifying a size? Or is using a size the only way to target mobile devices, and not desktops?

解决方案

In the CSS3 spec, @media handeld is mentioned but it has perhaps no browser support.

So, no.

However, you might find this site useful, it explains other some media query techniques for mobile.

这篇关于css媒体查询:目标移动设备,而不指定宽度,像素比率等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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