是否有人知道以下CSS为什么无法在Safari上显示我的背景图像?请注意,此CSS在其他浏览器上显示了我的背景图片:

.thGridColumnHeader
{
    background-image: url('../Images/Textures/glass.png');
    background-image: none,-webkit-linear-gradient(top,rgba(255,255,255,.12) 0,rgba(255,255,255,.08) 50%,rgba(255,255,255,.05) 51%,rgba(255,255,255,.0) 100%);
    background-image: none,-moz-linear-gradient(top,rgba(255,255,255,.12) 0,rgba(255,255,255,.08) 50%,rgba(255,255,255,.05) 51%,rgba(255,255,255,.0) 100%);
    background-image: none,-o-linear-gradient(top,rgba(255,255,255,.12) 0,rgba(255,255,255,.08) 50%,rgba(255,255,255,.05) 51%,rgba(255,255,255,.0) 100%);
    background-image: none,linear-gradient(to bottom,rgba(255,255,255,.12) 0,rgba(255,255,255,.08) 50%,rgba(255,255,255,.05) 51%,rgba(255,255,255,.0) 100%);
    background-position: 50% 50%;
    background-color: #1d1d1d;
}


这是其他浏览器的输出



这是野生动物园的输出

最佳答案

我只是通过在CSS类中进行以下调整来解决我的问题。

.thGridColumnHeader
{
    background-image: none,-webkit-linear-gradient(top,rgba(255,255,255,.12) 0,rgba(255,255,255,.08) 50%,rgba(255,255,255,.05) 51%,rgba(255,255,255,.0) 100%);
    background-image: none,-moz-linear-gradient(top,rgba(255,255,255,.12) 0,rgba(255,255,255,.08) 50%,rgba(255,255,255,.05) 51%,rgba(255,255,255,.0) 100%);
    background-image: none,-o-linear-gradient(top,rgba(255,255,255,.12) 0,rgba(255,255,255,.08) 50%,rgba(255,255,255,.05) 51%,rgba(255,255,255,.0) 100%);
    background-image: none,linear-gradient(to bottom,rgba(255,255,255,.12) 0,rgba(255,255,255,.08) 50%,rgba(255,255,255,.05) 51%,rgba(255,255,255,.0) 100%);
    background-position: 50% 50%;
    background-color: #1d1d1d;
    background-image: url('../Images/Textures/glass.png');
}


我已经将下面的代码转移到CSS类的最后一部分,并且可以正常工作。

    background-image: url('../Images/Textures/glass.png');


这是safari上的输出:

关于html - Safari上未显示背景图片,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17288790/

10-11 13:21