Html 响应性设计It';它不在IE7和IE8中工作

Html 响应性设计It';它不在IE7和IE8中工作,html,css,internet-explorer,responsive-design,media-queries,Html,Css,Internet Explorer,Responsive Design,Media Queries,你好,朋友们,请帮助我,我用过各种方法,但响应式设计,它在IE中不起作用。我用过所有方法。我还使用了css-mediaqueries.js。这没用请帮帮我 在这里,我将为您提供我的html页面示例: 主要Css ** 请告诉我的朋友们,我在这两者之间缺少了什么 在之间加空格!重要信息和实际值 @media screen and (min-width: 768px) and (max-width: 979px) { header{ background:#FF0000 !i

你好,朋友们,请帮助我,我用过各种方法,但响应式设计,它在IE中不起作用。我用过所有方法。我还使用了css-mediaqueries.js。这没用请帮帮我

在这里,我将为您提供我的html页面示例:

主要Css

**


请告诉我的朋友们,我在这两者之间缺少了什么

之间加空格!重要信息
和实际值

@media screen and (min-width: 768px) and (max-width: 979px) {
    header{
        background:#FF0000 !important;
    }
}
@media screen and (max-width: 767px) {
    header{
        background:#069 !important;
    }
}
@media screen and (max-width: 480px) {
    header{
        background:#36F !important;
    }
}

此外,如果您是以更好的方式编码的,即“移动优先”,那么更好的做法是为您的IE7和IE8浏览器提供移动视图,而不使用JS作为默认视图。@Jefferson Ribeiro的链接中推荐了这种做法。它会起作用。

前面的答案应该可以解决这个问题,但这里更重要的问题是:为什么您希望它在IE7和IE8上响应?

响应式网站的唯一用途是用于手机和平板电脑

第一款移动Windows设备以IE10开始,这意味着IE7-9不用于任何手机/平板电脑


换句话说,在IE7和IE8上使站点响应是不必要的。

您确定respond.js的路径正确吗?您是在本地测试还是在现场测试?有些脚本可能无法在本地工作,但它们可以在实时站点上工作。我检查了respond.js,这是正确的。因为即使我再次下载了它。。。我还在线检查了脚本。。。仍然不工作..respond.js不支持所有类型的媒体查询,我会检查第一种是否是问题所在。双“和”逻辑可能超出插件支持的范围。唯一的目的是创建一个可以在任何设备上工作的站点。手机和平板电脑正是最明显的例子,说明了为什么你应该建立一个响应性强的系统。建立一个良好的流体响应网站,您仍然可以为ie8用户提供良好的体验。只要确保这是值得的时间。
@charset "utf-8";
/* CSS Document */
@media screen and (min-width: 768px) and (max-width: 979px) {
    header{ background:#FF0000!important;
    }
}
@media screen and (max-width: 767px) {
        header{ background:#069!important;}
}
@media screen and (max-width: 480px) {
    header{ background:#36F!important;}
}
/*  Reset Styling
----------------------------------------------------------------------*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section, img {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}
* {
    outline: none;
    padding: 0px;
    margin: 0px
}
body{
    background:#999;}
header{ width:100%; background:#fff; height:150px; border-bottom:1px soild #333; margin:0px; padding:0px;}
@media screen and (min-width: 768px) and (max-width: 979px) {
    header{
        background:#FF0000 !important;
    }
}
@media screen and (max-width: 767px) {
    header{
        background:#069 !important;
    }
}
@media screen and (max-width: 480px) {
    header{
        background:#36F !important;
    }
}