Apple对浏览器嗅探的建议
Apple是否有任何建议使用任何技术进行浏览器嗅探(例如区分桌面IE / FF / Mobile Safari(即iPad))/其他平板电脑
Does Apple have any recommendation for using any technique for browser sniffing (e.g. to distinguish between desktop IE/ FF / Mobile Safari (i.e. iPad)) / Other tablets
我知道Apple希望我们避免使用User-agent。
I know Apple wants us to avoid using User-agent for the same.
媒体技术是否能够成为区分iPad和Xoom的简单方法?
Is the media technique foolproof way to differentiate between iPad and say Xoom?
<link rel="stylesheet" media="all and (min-device-width: 481px) and (max-device-width: 1024px)" href="ipad.css">
而不是尝试检测设备/用户代理,您希望专注于检查浏览器的功能。这包括屏幕分辨率,JS支持,CSS支持等。
Rather than trying to detect device/user-agent, you want to focus on checking the capabilities of the browser. This includes screen resolution, JS support, CSS support, and more.
媒体查询只是众多技术中的一种,可以使您的网站在许多设备上正常运行。为了帮助您入门,以下是一些有用的资源:
Media queries is only one of many techniques you can employ to make your website work well across many devices. To get you started, here are a few helpful resources:
- Modernizr - 一个JS库,可以检测浏览器功能并添加方便的CSS类和JS方法来检查这个
- 动员您的HTML5网站 - HTML5 Rocks - 关于各种技术的文章
- Yiibu - 概念验证,逐步增强的网站
- 在现实世界中使用媒体查询 - Broken Links - 一篇文章,宣传以准系统样式表开始,然后使用媒体查询在顶部添加额外的样式
- Modernizr - A JS library that detects browser capabilities and adds handy CSS classes and JS methods to check this
- "Mobifying" your HTML5 site - HTML5 Rocks - An article on various techniques
- Yiibu - a proof of concept, progressively enhanced site
- Using media queries in the real world - Broken Links - An article promoting starting with a barebones stylesheet and then using media queries to add extra styles on top