线性渐变在Edge和IE11中不起作用

时间:2017-08-24 19:27:31

标签: html css background-image background-blend-mode

我的CSS没有在Microsoft Edge和IE11中显示背景图像。 它似乎与那些浏览器中的线性渐变有关。背景颜色显示,但Edge和IE11中的图像不显示。有什么建议吗?

#DIV_1 {
    background-blend-mode: overlay, overlay;
    background-position: 50% 50%, 50% 50%;
    bottom: 0px;
    box-sizing: border-box;
    color: rgb(255, 255, 255);
    height: 400px;
    left: 356.25px;
    position: absolute;
    right: -356.25px;
    text-decoration: none solid rgb(255, 255, 255);
    text-size-adjust: 100%;
    top: 0px;
    width: 356.25px;
    column-rule-color: rgb(255, 255, 255);
    perspective-origin: 178.125px 200px;
    transform-origin: 178.125px 200px;
    caret-color: rgb(255, 255, 255);
    background: linear-gradient(rgb(0, 174, 217) 0%, rgb(23, 36, 169) 100%) no-repeat scroll 50% 50% / cover padding-box border-box, rgba(0, 0, 0, 0) url("http://www.purpleelephantpolitics.com/wp-content/uploads/2017/03/New-Pics-Of-Ducks-26-For-Line-Drawings-with-Pics-Of-Ducks.jpg") no-repeat scroll 50% 50% / cover padding-    box border-box;
    border: 0px none rgb(255, 255, 255);
    font: normal normal normal normal 16px / 22.8571px "Proxima Nova";
    outline: rgb(255, 255, 255) none 0px;
}/*#DIV_1*/

https://jsfiddle.net/t6j11zm4/

1 个答案:

答案 0 :(得分:0)

background-blend-modenot supported on Edge and IE

您可以使用pseudo-element叠加层创建类似的内容

将图片悬停以查看效果:

body {
  background: #131418;
  text-align: center;
  margin: 1em auto;
}

.my-image-parent {
  display: inline-block;
  width: 300px;
  height: 300px;
  text-align: center;
}

.my-image {
  width: auto;
  height: 100%;
  background: url(https://unsplash.it/400/400);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.my-image {
  position: relative;
}

.my-image:after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: radial-gradient(circle at 30% 107%, rgba(253, 244, 151, 0.5) 0%, rgba(253, 244, 151, 0.5) 5%, rgba(253, 89, 73, 0.6) 45%, rgba(214, 36, 159, 0.6) 60%, rgba(40, 90, 235, 0.6) 90%);
  opacity: 0;
  transition: all ease 1s;
}

.my-image:hover:after {
  opacity: .5;
}
<div class="my-image-parent">
  <div class="my-image"></div>
</div>