适用于 iPhone/Android 的独家 CSS [英] Exclusive CSS for iPhone/Android
问题描述
我正在为我的页面制作适合移动设备的样式表.有没有一种简单的方法可以让它向 iPhone/Android 用户显示该样式表?或者我是否必须拉动用户代理并以这种方式解决它 - 我该怎么做?
I'm making a mobile-friendly stylesheet for a page of mine. Is there a simple way to make it show that stylesheet to iPhone/Android users? Or do I have to pull the user-agents and figure it out that way - and how do I do that?
还有 - 有什么工具可以让这种网络开发更容易?
Also - any tools to make this sort of web dev easier?
推荐答案
如果你的样式表对于 iOS/android 是相同的,你可以做这样的事情.
You could do something like this, if your stylesheet is the same for iOS/android.
<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="css/mobile.css" type="text/css"/>代码>
但是如果您要检测是 iOS 还是 Android,则需要进行检测.
But if you're trying to detect if it's the iOS OR Android, then you'll need to do detection.
在使移动开发更容易方面,有很多东西:
In terms of making mobile dev easier, there's a ton of stuff:
- http://www.phonegap.com/
- http://www.sencha.com/products/touch/
- http://www.appcelerator.com/
- http://www.jquerymobile.com/
- http://www.jqtouch.com/
有一些可以帮助您入门:)
There's a few to get you started :)
希望这会有所帮助.
这篇关于适用于 iPhone/Android 的独家 CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!