简体   繁体   中英

How to load a custom stylesheet for 2 useragents?

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/533.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?

本教程应该会有所帮助,它会详细说明: http : //davidwalsh.name/detect-ipad

如果您使用php ,只需检查$_SERVER['HTTP_USER_AGENT']所需的值,然后将<link href="yourstyle.css" rel="stylesheet" type="text/css">放置在head标签中

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM