使用以下内容在我的浏览器中加载了所有三个css文件,然后应用了medium-device.css
样式
<link rel="stylesheet"
media="only screen and (max-width: 480px),
only screen and (max-device-width: 480px)"
href="/assets/css/small-device.css" />
<link rel="stylesheet"
media="only screen and (max-width: 1024px),
only screen and (max-device-width: 1024px)"
href="/assets/css/large-device.css" />
<link rel="stylesheet"
media="only screen and (max-width: 1024px),
only screen and (max-device-width: 1024px)"
href="/assets/css/medium-device.css" />
这会导致加载非重要文件,从而增加加载时间!
如何阻止浏览器加载不合适的css文件?