Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.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
Android 针对移动浏览器的特定于浏览器的CSS_Android_Css_Firefox_Mobile_Opera - Fatal编程技术网

Android 针对移动浏览器的特定于浏览器的CSS

Android 针对移动浏览器的特定于浏览器的CSS,android,css,firefox,mobile,opera,Android,Css,Firefox,Mobile,Opera,如何在Android上对不同的移动浏览器(如Opera mobile和Firefox)进行媒体查询?当我使用某些浏览器时,CSS真的会崩溃。你不能直接使用CSS,但你可以使用 // target mobile devices @media only screen and (max-device-width: 480px) { body { max-width: 100%; } } // recent Webkit-specific media query to target the i

如何在Android上对不同的移动浏览器(如Opera mobile和Firefox)进行媒体查询?当我使用某些浏览器时,CSS真的会崩溃。

你不能直接使用CSS,但你可以使用

// target mobile devices
@media only screen and (max-device-width: 480px) {
    body { max-width: 100%; }
}

// recent Webkit-specific media query to target the iPhone 4's high-resolution Retina display
@media only screen and (-webkit-min-device-pixel-ratio: 2) {
    // CSS goes here
}

// should technically achieve a similar result to the above query,
// targeting based on screen resolution (the iPhone 4 has 326 ppi/dpi)
@media only screen and (min-resolution: 300dpi) {
    // CSS goes here
}
您还可以在HTML中定义

<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="css/mobile.css" type="text/css" />
<link rel="stylesheet" media="only screen and (-webkit-min-device-pixel-ratio: 2)" href="css/mobile.css" type="text/css" />
<link rel="stylesheet" media="only screen and (min-resolution: 300dpi)" href="css/mobile.css" type="text/css" />

我觉得你的问题太宽了。例如,有很多关于媒体查询的文章,但最好是用更具体的术语来描述你的问题所在。