animation - css3 动画 : div is not correct size

标签 animation css

        .wheel {
            width: 50px !important;
            height: 50px !important;
        }

            .wheel1 {    
                width: 100%;
                height: 100%;
                background-color: #3D3D3D;
                border-radius: 50% / 50%;
                position: absolute;    
            }

            .wheel2 {
                width: 80%;
                height: 80%;
                background-color: #B8B8B8;
                margin: 10%;    
                border-radius: 50% / 50%;
                position: absolute;

                -webkit-animation: wheelActive 1s;
                -webkit-animation-iteration-count: infinite;

                -moz-animation: wheelActive 1s;
                -moz-animation-iteration-count: infinite;

                -ms-animation: wheelActive 1s;
                -ms-animation-iteration-count: infinite;

                -o-animation: wheelActive 1s;
                -o-animation-iteration-count: infinite;

                animation: wheelActive 1s;
                animation-iteration-count: infinite;
            }

            @-webkit-keyframes wheelActive
            {
                0%   { margin: 5%; height: 90%; width: 90%; }
                50%  { margin: 0%; height: 100%; width: 100%; }
                100% { margin: 5%; height: 90%; width: 90%; }

            }

            @-moz-keyframes wheelActive
            {
                0%   { margin: 5%; height: 90%; width: 90%;  }
                50%  { margin: 0%; height: 100%; width: 100%;  }
                100% { margin: 5%; height: 90%; width: 90%;  }

            }

            @-ms-keyframes wheelActive
            {
                0%   { margin: 5%; height: 90%; width: 90%;  }
                50%  { margin: 0%; height: 100%; width: 100%;  }
                100% { margin: 5%; height: 90%; width: 90%;  }

            }

            @-o-keyframes wheelActive
            {
                0%   { margin: 5%; height: 90%; width: 90%;  }
                50%  { margin: 0%; height: 100%; width: 100%;  }
                100% { margin: 5%; height: 90%; width: 90%;  }

            }

            @keyframes wheelActive
            {
                0%   { margin: 5%; height: 90%; width: 90%;  }
                50%  { margin: 0%; height: 100%; width: 100%;  }
                100% { margin: 5%; height: 90%; width: 90%;  }

            }

http://jsfiddle.net/LXEXU/

我正在尝试制作一个看起来会旋转的轮子,但它不起作用。轮子不是 50px x 50px。我怎样才能使这项工作?谢谢!

最佳答案

添加position:relative; .wheel 使其成为 50px X 50px http://jsfiddle.net/LXEXU/1/

关于animation - css3 动画 : div is not correct size,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11034043/

相关文章:

ios SWRevealViewController 显示推送 segue 动画

html - 使用 CSS 更改所选元素的颜色

java - LibGDX:如何在等距平铺 map 上制作动画?

javascript - .animate() slider 无法正常工作

javascript - 将动画滚动与另一个 ahref 函数一起使用

css - 自定义大小的线性渐变

html - 如何让 child 成长并包裹在第一个元素下面?

html - Bootstrap 面板不适用于某些颜色

滚动时iOS链接背景颜色发生变化

wpf - 无法在 WPF 中设置动画后的属性