html - IE 版本 11 中的背景颜色和边框行为异常

标签 html css

<分区>


关闭 8 年前

我正在努力让 IE 11 像 Chrome 和 FF 一样运行,但我不确定该怎么做...

这是代码:

#main {
    position: relative;
    top: 20px;
    height: 400px;
    -webkit-background-color: rgba(72, 72, 72, 0.2);
    background-color: rgba(72, 72, 72, 0.2);
    /*background-color: #484848;*/
    width: 460px;
    margin: 0 auto;
    -webkit-border-radius: 5px;
    -webkit-border: 1px solid #a1a1a1;
    border-radius: 5px;
    border: 1px solid #a1a1a1;
}

这是视觉上的效果......

enter image description here

半透明的 background-color 被忽略,border-radius 也是如此。此外,Chrome 的行为与 FF 相同......

任何提示将不胜感激

丹尼斯

这是该部分的 HTML:

<main id="main">
  <div id="resultContainer">
    <section id="i0" class="wDay">
        <h2>
            <span class="day" ></span>
            <span class="temp" ></span>
        </h2>
        <img src="">
        <span class="wDescript" style="color:#2050ff;word-break:break-all;"></span> 
        <span class="wind" ></span><br/> 
        <span class="humid" ></span> 
        <span class="other1" ></span> 
        <span class="other2" ></span> 
    </section>
    <section id="i1" class="wDay">
        <h2>
            <span class="day" ></span>
            <span class="temp" </span>
        </h2>
        <img src="">
        <span class="wDescript" style="color:#2050ff;word-break:break-all;"></span> 
        <span class="wind" ></span><br/> 
        <span class="humid" ></span> 
        <span class="other1" ></span> 
        <span class="other2" ></span> 
    </section>
    <section id="i2" class="wDay">
        <h2>
            <span class="day" ></span>
            <span class="temp" </span>
        </h2>
        <img src="">
        <span class="wDescript" style="color:#2050ff;word-break:break-all;"></span> 
        <span class="wind" ></span><br/>  
        <span class="humid" ></span> 
        <span class="other1" ></span> 
        <span class="other2" ></span> 
    </section>
    <section id="i3" class="wDay">
        <h2>
            <span class="day" ></span>
            <span class="temp" </span>
        </h2>
        <img src="">
        <span class="wDescript" style="color:#2050ff;word-break:break-all;"></span> 
        <span class="wind" ></span><br/>  
        <span class="humid" ></span> 
        <span class="other1" ></span> 
        <span class="other2" ></span> 
    </section>
  </div>
</main>

最佳答案

打开开发者工具并确保浏览器处于标准模式。如果您处于兼容模式,您将不会在 IE 中看到这些样式。

尝试添加 X-UA-Compatible 元标记以强制使用标准模式。

<meta http-equiv="X-UA-Compatible" content="IE=Edge">

关于html - IE 版本 11 中的背景颜色和边框行为异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25290942/

上一篇:html - 为什么 HTML 元素的居中会受到其侄子宽度的影响?

下一篇:jquery - 将 div 固定到 100% 容器的底部并允许 while 容器滚动

相关文章:

html - overflow hidden 的CSS3缩放动画

html - 如何使第三部分图像对齐顶部?

css - IE9 css 媒体查询无法正常工作......在其他任何地方都可以正常工作

html - 如何设置菜单事件链接背景

html - CSS/Bootstrap 将文本包裹在圆形图像的一侧

javascript - 围绕任意点旋转 : HTML5 Canvas

html - 几行内相同高度的行内 block 元素

css - 适合div中的图像

html - 我的网站无法在 FireFox 中正确加载

html - Primeng 样式在 Angular 4 中不起作用