Safari和Firefox无法加载背景渐变

时间:2019-02-13 09:15:53

标签: css css3 cross-browser gradient linear-gradients

尝试制作背景渐变以在Safari和Firefox上运行。在Chrome上可以完美运行:

.gq_s_background_gradient:after {
    content: "";
    display: block;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-image: linear-gradient(360deg,rgba(43,135,218,0.3) 0%,#161616 85%);
    animation-duration: 2500ms;
    animation-delay: 700ms;
    opacity: 0;
    -webkit-animation-name: et_pb_fade;
    animation-name: et_pb_fade;
    -webkit-animation-fill-mode: both !important;
    animation-fill-mode: both !important;}

1 个答案:

答案 0 :(得分:0)

为什么使用opacity:0? 和

设置所有浏览器的背景:

background-image:

-webkit-linear-gradient(360deg,rgba(43,135,218,0.3) 0%,#161616 85%);

background-image:-moz-linear-gradient(360deg,rgba(43,135,218,0.3) 0%,#161616 85%);  

background-image:-o-linear-gradient(360deg,rgba(43,135,218,0.3) 0%,#161616 85%);

background-image:   linear-gradient(360deg,rgba(43,135,218,0.3) 0%,#161616 85%);