0

我的 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/

4

1 回答 1

0

background-blend-modeEdge 和 IE 不支持。

您可以使用伪元素叠加创建类似的东西

悬停图片查看效果:

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>

于 2017-08-24T19:59:04.857 回答