Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/91.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
Php 如何包含css取决于运行环境_Php_Html_Css - Fatal编程技术网

Php 如何包含css取决于运行环境

Php 如何包含css取决于运行环境,php,html,css,Php,Html,Css,我的网站有手机css和桌面css,我已经包括了它们 <link rel="stylesheet" type="text/css" media="only screen and (max-width: 1320px)" href="styles/responsive-grid/small-desktop.css" /> <link rel="stylesheet" type="text/css" media="only screen and (max-width:

我的网站有手机css和桌面css,我已经包括了它们

<link rel="stylesheet" type="text/css" media="only screen and (max-width: 1320px)" href="styles/responsive-grid/small-desktop.css" />
        <link rel="stylesheet" type="text/css" media="only screen and (max-width: 990px)" href="styles/responsive-grid/tablet.css" />
        <link rel="stylesheet" type="text/css" media="only screen and (max-width: 660px)" href="styles/responsive-grid/mobile.css" />
        <link rel="stylesheet" type="text/css" media="only screen and (max-width: 990px)" href="styles/tablet.css" />
        <link rel="stylesheet" type="text/css" media="only screen and (max-width: 660px)" href="styles/mobile.css" />

这个工作很好,但是
我需要在桌面上只包含桌面css,在移动设备上只包含移动css,以减少请求

在类似的东西上进行尝试或编写自己的javascript。

我已经尝试过了,但页面加载需要花费很多时间