CSS - 背景颜色在IE11中不起作用(CSS - background-color not working in IE11)

我有以下代码:

.skills_column {

padding: 50px !important;

padding-top: 60px !important;

&.--light {

background-color: white;

}

&.--dark {

background-color: #ced4db;

}

@include media-breakpoint-down(sm) {

h1 {

text-align: center;

}

}

}

有3列,一个轻,两个暗。 所有这些都适用于Chrome和Firefox,但它在IE11中不起作用:

虽然光线是预期的白色,但另外两个应该是黑暗的列在IE11中也是白色的。

问题是什么? 我还尝试添加filter: none !important; 因为我在某个地方看过,但这似乎没有什么区别,虽然我可能没有正确应用它,我不确定。

我也在使用flexbox,如果这应该有所作为。 但我的问题是没有应用背景颜色。

I have the following code:

.skills_column {

padding: 50px !important;

padding-top: 60px !important;

&.--light {

background-color: white;

}

&.--dark {

background-color: #ced4db;

}

@include media-breakpoint-down(sm) {

h1 {

text-align: center;

}

}

}

There are 3 columns, a light one, and two dark ones. All of this works in Chrome & Firefox, however, it does not work in IE11:

While the light one is white as expected, the two other columns which are supposed to be dark, are also white when viewed in IE11.

What could the problem be? I also tried to add filter: none !important; because I read that somewhere, but that does not seem to make a difference although I might have not applied it correctly, I am not sure.

I am also using flexbox, if that should make a difference. But my problem here is with the background colors not being applied.

原文:https://stackoverflow.com/questions/44923626

更新时间:2019-11-18 14:41

最满意答案

您可以尝试从类名中删除双连字符( --dark , - --light )。 我有一种感觉IE不喜欢BEM表示。 也许单下划线或双下划线有效。

.skills_column {

padding: 50px !important;

padding-top: 60px !important;

&._light {

background-color: white;

}

&._dark {

background-color: #ced4db;

}

@include media-breakpoint-down(sm) {

h1 {

text-align: center;

}

}

}

Can you try removing the double hyphen from your class names(--dark, --light). I have a feeling IE doesn't like BEM representations. Maybe single underscore or double underscore works.

.skills_column {

padding: 50px !important;

padding-top: 60px !important;

&._light {

background-color: white;

}

&._dark {

background-color: #ced4db;

}

@include media-breakpoint-down(sm) {

h1 {

text-align: center;

}

}

}

相关问答

有两件事阻止了动画在IE11中的工作,它们如下所示: 将animation-play-state设置为以简写形式running时,IE11始终存在问题。 这是没有道理的,它应该被认为是一个错误。 解决这个问题应该是从简写中删除running 。 这不会造成伤害,因为animation-play-state的默认值正在running 。 父按钮容器的尺寸仅为10px x 10px,而伪元素在动画过程中最终会获得60px x 60px的尺寸。 虽然其他浏览器通过默认显示溢出,IE11似乎正在裁剪它。

...

我相信这里的问题是缺乏初始高度。 如果您在元素上循环,并将其高度设置为等于其计算的高度样式的高度,则可以使用折叠样式将高度覆盖为0px,从而触发两个显式数字之间的过渡。 var box = document.querySelector( ".box" );

// Set the box's initial height to its computed height

box.style.height = window.getComputedStyle( box ).height;

//

...

尝试将此属性添加到链接标记:type =“text / css”示例:

I know this is an old problem, but I ran into it trying to solve the same problem with my webserver. IE/Edge was not honouring the css genera

...

您可以尝试从类名中删除双连字符( --dark , - --light )。 我有一种感觉IE不喜欢BEM表示。 也许单下划线或双下划线有效。 .skills_column {

padding: 50px !important;

padding-top: 60px !important;

&._light {

background-color: white;

}

&._dark {

background-color: #ced4db;

}

@incl

...

也许IE无法处理显示:table(-cell)样式。 尝试使用普通(内联)块样式显示它: #menu {

padding: 0;

margin: 0;

white-space: nowrap;

font-size: 0;

position: relative;

}

#menu * {

font-size: 16px;

list-style-type: none;

padding: 0;

margin: 0

...

你可以添加这行到你的CSS,它会让你的工作。 你只需要将不透明度的等级从0.3调整到你想要的任何等级。 测试和边缘工作。 box-shadow:inset 0 0 0 2000px rgba(84,179,234,0.3);

这里是小提琴 http://jsfiddle.net/dQy8A/35/ You can add this line to your css and it will get it working for you. You just have to adjust the le

...

如果您希望能够悬停它,则需要从图像标记中删除pointer-events:none的内联样式pointer-events:none 。 通过将其设置为none,这意味着您的鼠标无法与元素交互,因此它无法将鼠标悬停以显示标题。 尝试这个:

显示有和没有指针事件的示例小提示 有关指针事件的更

...

根据我的经验,你不能使用IE浏览::after或::before ,因此属性全部被删除,只是因为它们在某些方面不属于选定的元素本身,而是属于它的pesudo。 我发现使其看起来像在其他浏览器中的唯一方法是改变::before样式属性值: header .wrapper .primary-menu #menu-primary-menu > li > .sub-menu::before {

-ms-flex-item-align: center;

-ms-grid-row-align:

...

仅当“仿真”模式设置为IE8或更低时,IE Inspector中的卷曲线才会出现 - 从而表示此属性在当前模式下不会被超出。 但是,如果在Edge模式下使用IE11,则可能会有一些强制兼容模式的元属性

或者,也许您的Windows客户端默认配置为使用comaptibility模式, 请参阅此答案了解详情: Internet Explorer 11通过

...

您可以使用纯JavaScript执行相同的操作并一起删除CSS表达式。 要么 如果您感到懒惰或不想使用JS,请尝试设置文档模式:

将其添加到

...部分。 请注意,这可能会破坏您可能使用过的IE7不支持的属性。 为什么要避免使用CSS表达式: 从Internet Explorer 11开始,不再为Internet区域中加载的网页启用CSS表达式。 当

...

计算机底纹不起作用,CSS - 背景颜色在IE11中不起作用(CSS - background-color not working in IE11)...相关推荐

  1. css中背景颜色用哪个,CSS 背景颜色

    颜色背景 CSS中背景颜色由background-color决定,这里的背景颜色会渲染padding和content,不会渲染border和margin部分. 在css3中可以通过background ...

  2. 从零开始学前端:CSS背景颜色 --- 今天你学习了吗?(CSS:Day09)

    从零开始学前端:程序猿小白也可以完全掌握!-今天你学习了吗?(CSS) 复习:从零开始学前端:CSS字体属性和文本属性 - 今天你学习了吗?(CSS:Day08) 文章目录 从零开始学前端:程序猿小白 ...

  3. html背景图片横屏,CSS背景颜色 背景图片 居中 重复 固定样式background经验篇

    我们使用CSS Background样式属性,可以设置网页背景单一颜色.网页背景为图片.网页背景图片居中于网页.网页背景图片网页固定位置.网页背景图片中网页中重复平铺等css背景样式介绍与案例讲解. ...

  4. html滚动背景色没了,css背景颜色不显示怎么解决

    css背景颜色不显示怎么解决 div css新手布局会遇到布局的背景颜色无法显示,一般布局背景无法显示通常原因如下: 1.由使用float浮动造成浮动产生无法显示css背景颜色 2.高度不够而产生背景 ...

  5. php渐变背景颜色,css背景颜色渐变案例:线性渐变和径向渐变效果实例详解

    渐变是两种或多种颜色之间的平滑过渡.以前,必须使用图像来实现这些效果.但是,通过使用 CSS3 渐变(gradients),可以减少下载的事件和宽带的使用.此外,渐变效果的元素在放大时看起来效果更好, ...

  6. ie11 no java plugin,修復Javascript在IE11中不起作用

    說明 To Fix (Javascript not working in IE11) error you need to follow the steps below: STEP 1: STEP 2: ...

  7. css修改select选择框option被选中的背景颜色_这五个有用的 CSS 属性完全被我忽视了...

    作者 | Desiré译者 | 苏本如,责编 | 郭芮头图 | CSDN 下载自视觉中国出品 | CSDN(ID:CSDNnews) 以下为译文: 各位网友,大家好!?今天,我想在这里和大家分享一些我 ...

  8. css的背景颜色有哪些,css背景颜色、背景图片,以及列表的多种样式

    背景样式 • background-color 设置元素的背景颜色. • background-image 把图像设置为背景. • background-position 设置背景图像的起始位置. • ...

  9. html中背景色优先级,CSS背景颜色优先级

    我正在使用jQuery更改表格行的颜色,我注意到在以下实例中我得到了不同的结果. CSS如下: .normalcolor { background-color: #dedede; } .reddish ...

最新文章

  1. java 连续打印_Java实现连续打印ABC
  2. SAP新财务系列之科目层次
  3. redis集群学习一些记录
  4. 编程之美 set 12 快速找出故障机器
  5. asp.net2.0跨域问题
  6. 编程界的“二向箔”——Dart元编程
  7. JAVA编写的火车票售票系统
  8. string 转 json_手写Json解析器学习心得
  9. Mysql学习总结(35)——Mysql两千万数据优化及迁移
  10. JQueryDOM之属性操作
  11. linux系统启动后卡在笑脸符号,【转】Linux中的特殊符号
  12. DONET中常用的一些快捷键收集。
  13. 省教育厅关于印发《湖北省义务教育阶段信息技术课程指导意见(试行)》的通知
  14. FFmpeg将MP4视频切割成ts文件
  15. opencv python 实现图片添加带透明的 logo
  16. python合并多个pdf_python使用PyPDF2把多个pdf文件合并成一个
  17. NRF24L01-状态寄存器
  18. Android应用优化之流畅度优化实操
  19. 证件照换背景,excel2步搞定!
  20. 全国大学生英语竞赛考题总结

热门文章

  1. python logging日志分割_python logging日志模块以及多进程日志
  2. nodejs路由信息
  3. Scipy信号分析处理(基线漂移、滤波)(笔记01)
  4. springboot细节挖掘(日志系统)
  5. Netty的核心组件
  6. Docker实践(二)镜像
  7. asp activex 读取服务器上的文件,webshell中上传asp文件调用服务器ActiveX控件溢出获取shell...
  8. access的papersize命令_巡检命令及查看参数
  9. java 异常限制_java的异常限制
  10. PHP判断msg,小程序 msgSecCheck 检查内容是否违规违法,但所有内容都可通过问题...