我有以下代碼:線性背景圖像不工作正確的探險之旅
body{
background:red;
}
div{
width:100%;
height:100%;
background-image: -moz-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0));
background-image: -ms-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0));
background-image: -webkit-gradient(linear, 0 0, 100% 0, from(rgba(255, 255, 255, 1)), to(rgba(0, 0, 0, 0)));
background-image: -webkit-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0));
background-image: -o-linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0));
background-image: linear-gradient(left, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0));
background-repeat: repeat-x;
}
和HTML:
<div>
test
</div>
正如你可以在這裏看到,它會顯示不同的Chrome和Safari之間:
http://codepen.io/anon/pen/apwoGj
爲什麼會這樣呢?
https://css-tricks.com/thing-know-gradients-transparent-black/ –