I have two user agent strings:
Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3
Mozilla/5.0 (iPad; U; CPU OS 4_3_2 like Mac OS X; en-us) AppleWebKit/5开发者_如何学Python33.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5
The first targets iOS5 and the second targets iOS4.
Is it possible to load a custom stylesheet for the first user agent string, then a different one for the later user agent string?
this tutorial should be helpful, it explains it in details : http://davidwalsh.name/detect-ipad
if you uses php, just check $_SERVER['HTTP_USER_AGENT']
for value you need and place <link href="yourstyle.css" rel="stylesheet" type="text/css">
in head tag
精彩评论