私はボウルがy軸上でバウンドする単純なプログラムを作っていますが、x軸上で動かす方法もわかりません。 x軸変換の値を0から正または負の値に変更すると、ボールドが消えます。助けてください!また、css3アニメーションでx軸上にアニメーションが必要です
<html>
<head>
\t <title>bounce</title>
\t <style>
\t \t *{margin: 0 auto;}
\t \t div
\t \t {
\t \t \t width: 200px;
\t \t \t height: 200px;
\t \t \t background-color: #FFDEAD;
\t \t \t border-radius: 100%;
\t \t \t border:5px solid black;
\t \t \t margin-top: -250px;
\t \t \t animation:bounce 2s linear forwards;
\t \t }
\t \t p{
\t \t \t text-align: center;
\t \t \t margin-top:46%;
\t \t }
\t \t @keyframes bounce
\t \t {
\t \t \t 0%{transform:translate(0,-250px);}
\t \t \t 20%{transform:translate(0,450px);}
\t \t \t 40%{transform:translate(0,330px);}
\t \t \t 50%{transform:translate(0,450px);}
\t \t \t 65%{transform:translate(0,370px);}
\t \t \t 75%{transform:translate(0,450px);}
\t \t \t 90%{transform:translate(0,400px);}
\t \t \t 100%{transform:translate(0,450px);}
\t \t }
\t </style>
</head>
<body>
\t <div><p>this is a div</p></div>
</body>
</html>
感謝.. –
@Harley答えは参考になりました場合は受け入れる/ upvoteしてください – XYZ