css - 使这个 CSS 在 IE8 中工作

标签 css internet-explorer-8

我无法在 IE8 中完成一些样式设置。该元素最初不支持 AS 跨浏览器以返回到 IE8,但现在必须支持,因此我正在尝试对该网站上的此 CSS 进行必要的更改。

这是网站的第一个页面部分,主页部分位于顶部,带有 Logo 和注册框。此部分的 CSS 如下所示:

#page-div-home{
    height:auto;
    background:url('../img/_Pics/bg.png') 50% 40%;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: fixed;

    .logo{
        width:100%;
        max-width:1000px;
        height:300px;
        margin-top:100px;
        display:inline-block;

        background:url('../img/_Logos/eSchoolLogo.png');
        background-repeat: no-repeat;
        background-size: 100%;
        background-position: fixed;
    }

}

它还有两个半页宽部分的媒体查询,如下所示:

.sub-wrap{
width:100%;
max-width:1500px;
display:inline-block;
text-align:center;

@media screen and (max-width: 1340px){
    width:90%;
}

.sub-half{ //for FAQ section
    width:50%;
    height:auto;
    float:left;
    text-align:left; //a fix for the .sub-wrap text-align:center, all the FA
    padding:10px;

    box-sizing:border-box;
    -webkit-box-sizing:border-box;
    -moz-box-sizing:border-box;
    -ms-box-sizing:border-box;
    -o-box-sizing:border-box;

    @media screen and (max-width: 1340px){
        display:block;
        float:none;
        width:1000px;
        margin:0 auto;

        ul{
            padding:0;//this allows the <li>, when they are stacked, to take up full width of ul
        }
    }//media query(1340)

    @media screen and (max-width: 1125px){
        width:700px;
    }//media query(1125)

    @media screen and (max-width: 810px){
        width:100%;
    }

}//.sub-half

我不确定在所有使用的属性中到底是什么导致 IE8 错误地呈现页面(我想它根据其标准正确呈现它)但我想学习如何修复这些问题错误的。我还有一个 <header><nav>在顶部菜单中使用的标记是 position:fixed;永远不要在滚动条上移动。无论如何,我们将不胜感激。

最佳答案

您可以尝试将以下内容添加到 HTML 代码中的 head 部分:

<!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

关于css - 使这个 CSS 在 IE8 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24870028/

相关文章:

css - 如何让 Internet Explorer 8 支持第 n 个 child() CSS 元素?

css - IE8 中的背景图片问题

css - ie8 在第一页加载时不呈现/加载@font-face 字体

php - 循环自定义帖子类型

css 样式通过 ssl 消失

jquery - 在调整传单 map 的高度时在 Bootstrap 4 中显示/隐藏 div

html - 如何使用 CSS 将导航栏链接居中,同时保持两侧为灰色?

asp.net - xxx.eot 网络字体文件无法在 IIS 6.0 服务器上正常工作

css - 将 Material UI 按钮放置在行的最右侧

html - CSS :after image not showing up - IE8