2017-08-24 94 views
0

我的CSS未顯示Microsoft Edge和IE11中的背景圖像。 這似乎與這些瀏覽器中的線性漸變有關。背景顏色顯示出來,但不是Edge和IE11中的圖像。有什麼建議麼?線性漸變不能在邊緣和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/

+0

'背景 - 共混 - mode'不支持Edge和IE 。 –

+0

@Ihazkode知道一個polyfill或hack? – Tom

+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>