2

この CodePenを利用しようとしています。

ここに私の問題があります: http://jacobstone.co.uk/Livetesting/Vertical%20scroll%20text/index.html

現在、Chrome や Safari ではなく、Firefox でのみ動作させることができます。プレフィックスを間違って使用していますか? これを何年もの間機能させようとしてきました!

body{
font:normal 40px/50px Arial, sans-serif;
color:#999;
}
.anim p{
height:50px;
float:left;
margin-right:0.3em;
}
.anim b{
float:left;
overflow:hidden;
position:relative;
height:50px;
}
.anim span1{
display:inline-block;
color:#e74c3c;
position:relative;
white-space:nowrap;
top:0;
left:0;
/*animation*/
-webkit-animation:move 5s;
   -moz-animation:move 5s;
    -ms-animation:move 5s;
     -o-animation:move 5s;
        animation:move 5s;
/*animation-iteration-count*/
-webkit-animation-iteration-count:infinite;
   -moz-animation-iteration-count:infinite;
    -ms-animation-iteration-count:infinite;
     -o-animation-iteration-count:infinite;
        animation-iteration-count:infinite;
/*animation-delay*/
-webkit-animation-delay:1s;
   -moz-animation-delay:1s;
    -ms-animation-delay:1s;
     -o-animation-delay:1s;
        animation-delay:1s;
}
@keyframes move{
0%  { top: 0px; }
20% { top: -50px; }
40% { top: -100px; }
60% { top: -150px; }
80% { top: -200px; }
}

また、すべてのテキストを垂直方向に揃える方法はありますか?

4

2 に答える 2

4

ベンダー固有のプレフィックスも使用する必要があり@keyframesます。使用しているブラウザをチェックし、プレフィックスを自動的に追加するため、 Codepenで動作します。codepen の出力を調べると、お気づきでしょう。

@-webkit-keyframes move {
    0%  { top: 0px; }
    20% { top: -50px; }
    40% { top: -100px; }
    60% { top: -150px; }
    80% { top: -200px; }
}
@-moz-keyframes move {
    0%  { top: 0px; }
    20% { top: -50px; }
    40% { top: -100px; }
    60% { top: -150px; }
    80% { top: -200px; }
}
@-o-keyframes move {
    0%  { top: 0px; }
    20% { top: -50px; }
    40% { top: -100px; }
    60% { top: -150px; }
    80% { top: -200px; }
}
@keyframes move {
    0%  { top: 0px; }
    20% { top: -50px; }
    40% { top: -100px; }
    60% { top: -150px; }
    80% { top: -200px; }
}
于 2014-03-04T15:09:18.407 に答える
0

Codepen は機能しますが、あなたのサイトは機能しません。

キーフレームのプレフィックス付きバージョンも使用する必要があります。

@-webkit-keyframes

完全なリファレンスhttps://developer.mozilla.org/en-US/docs/Web/CSS/@keyframes

于 2014-03-04T14:57:18.623 に答える