Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html加载css如果检测到移动_Html_Css_Mobile - Fatal编程技术网

Html加载css如果检测到移动

Html加载css如果检测到移动,html,css,mobile,Html,Css,Mobile,我做得对吗?或者有更好的方法来实现这一点?您可以查看te用户代理并用php加载相应的代理。但是,使用该选项将您限制在320-480之间。BlackBerry就像240x320一样(至少是9xxx系列)您可以查看te用户代理并用php加载相应的代理。但是,使用该选项将您限制在320-480之间。黑莓手机就像240x320(至少是9xxx系列)就像科尔提到的那样,你可以查看用户代理。这是一些javascript,可以用来检测userAgent是否是iphone。() 如科尔所述,您可以检查userA

我做得对吗?或者有更好的方法来实现这一点?

您可以查看te用户代理并用php加载相应的代理。但是,使用该选项将您限制在320-480之间。BlackBerry就像240x320一样(至少是9xxx系列)

您可以查看te用户代理并用php加载相应的代理。但是,使用该选项将您限制在320-480之间。黑莓手机就像240x320(至少是9xxx系列)

就像科尔提到的那样,你可以查看用户代理。这是一些javascript,可以用来检测userAgent是否是iphone。()


如科尔所述,您可以检查userAgent。这是一些javascript,可以用来检测userAgent是否是iphone。()


<link media="only screen and (min-device-width : 320px) and (max-device-width : 480px)" href="smartphone.css" type= "text/css" rel="stylesheet" />
<link media="only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5)" href="iphone.css" type= "text/css" rel="stylesheet" />
<script language=javascript>
<!--
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
//Change the css
}
-->
 </script>