Going Mobile II
还是讨论mobile web design的话题,对之前的Going Mobile做些补充和修正。因为我的blog模板是完全用HTML5重写的,所有不支持HTML5以及CSS的移动设备浏览器全部忽略,我指的是此文只针对iPhone Safari,Google Android Chrome Lite以及Opera Mini/Mobile这些Modern Browsers。
善用@Media规则
Opera Mini/Mobile, Chrome Lite, iPhone Safari都支持@media规则,所以下面这行代码基本上就能搞定这些主流的移动设备浏览器了。
@import url(css/handheld.css) only screen and (max-device-width:480px)
如果你希望为iPhone Safari/Chrome Lite添加独立的样式表的话,加上-webkit prefix就可以了。
@import url(css/handheld_iphone.css) only screen and (-webkit-max-device-width:480px)

