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

时间:2015-02-13 10:49:28

标签: 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: 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,仅在移动设备上包含Mobile Css以减少请求

1 个答案:

答案 0 :(得分:0)

adapt.js这样的人或者写自己的javascript。