Home  >  Article  >  Web Front-end  >  Regarding the problem of referencing external CSS files to adapt to the screen_html/css_WEB-ITnose

Regarding the problem of referencing external CSS files to adapt to the screen_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:22:571538browse

CSS HTML adaptive

Straight to the point. In order to achieve the effect of adaptive screen, I achieved it by referencing external CSS through 2cdf5bf648cf2f33323966d7f58a7f3f.
The code is as follows
<link rel="stylesheet" type="text/css" media="screen and (max-device-width:1140px)" href="~/CSS/default/default1024.css" />    <link rel="stylesheet" type="text/css" media="screen and (min-width:1141px) and (max-device-width:1500px)" href="~/CSS/default/default1133.css"/>    <link rel="stylesheet" type="text/css" media="screen and (min-width:1501px) and (max-device-width:1800px)" href="~/CSS/default/default1500.css"/>    <link rel="stylesheet" type="text/css" media="screen and (min-width:1801px)" href="~/CSS/default/default1800.css"/>

The problem is: when I debug and run by changing the computer resolution, the css loading is completely normal, but when I put the website on IIS, Chrome browses normally, IE and 360 both The css is not loaded. When I don’t use media to judge and quote directly
<link rel="stylesheet" type="text/css" href="~/CSS/default/default1133.css"/>

, it is also normal. I don’t know the reason. Can you help me if you know it? Thank you~

Reply to discussion (solution)

IE does not support min_width in the early days
If 360 is in compatibility mode, it is early IE

In this case, you should find a way to set css through js

Just use JS to determine the size of the form and set the CSS.

Refer to this: http://my.oschina.net/lixx/blog/92386

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn