首页 > 解决方案 > Safari (iPhone) 上未显示 Gif 背景

问题描述

我有一个 gif 作为我网站上第一个 div 的背景。出于某种原因,背景不会出现在 safari(移动设备)上,但它在移动设备上的所有其他浏览器上都可以正常工作。gif 也会出现在桌面上的 safari 上。

我的 CSS:

@media screen and (max-width: 960px){
.introsection {
    background-size: 100% !important;
    -webkit-background-size: 100%;
    -moz-background-size: 100%;
    -o-background-size: 100%;
}
}

.introsection {
    position: relative;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    background: url('../../assets/img/calm_logo.gif') no-repeat center;
    background-attachment: fixed;
    background-color: #fff;
    z-index: 99999;
}

标签: htmlcsssafarimobile-safari

解决方案


推荐阅读