背景大小盖不使用​​CSS动画作品 [英] Background size cover does not work with CSS animation

查看:109
本文介绍了背景大小盖不使用​​CSS动画作品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用与背景大小盖CSS动画...但它似乎CSS动画覆盖背景大小:覆盖

I tried to use CSS animation with background size cover ... but it seems that CSS animation override the "background-size:cover"

访问jsfiddle.net/zNCY5/

Visit jsfiddle.net/zNCY5/

推荐答案

您需要把背景大小:盖; @keyframes 。这里是一个小提琴: http://jsfiddle.net/Ex2mT/

You need to put background-size: cover; in your @keyframes. Here is a fiddle: http://jsfiddle.net/Ex2mT/

@keyframes animation{   
    0%   {
        background:url(...) no-repeat top center fixed;
        background-size: cover;
    }
}

重复此对您有一个百分点。

Repeat this for each percentage you have.

这篇关于背景大小盖不使用​​CSS动画作品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆