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

WBOY
Release: 2016-06-24 12:22:57
Original
1538 people have browsed it

CSS HTML adaptive

Straight to the point. In order to achieve the effect of adaptive screen, I achieved it by referencing external CSS through .
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"/>
Copy after login

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"/>
Copy after login

, 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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!