看到很多朋友留言想要代码,这边分析一个压缩包!
我的抖音号:157680338
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>抖音玩着玩</title> <style> @keyFrames move{ 0%{ transform: translateY(300px); } 50%{ transform: translateY(150px); } 100%{ transform: translateY(0px); } } .text{ width: 300px; height: 300px; border: 2px solid #000; margin: 50px auto; overflow: hidden; } .text .toptext{ width: 300px; height: 300px; animation: move 15s linear infinite; text-align: center; } .text p{ margin: 5px; color: black; font-size: 18px; line-height: 30px; } </style> </head> <body> <div class='text'> <div class='toptext'> <p>这短短的一生</p> <p>我们最终都会失去</p> <p>你不妨大胆一些</p> <p>爱一个人</p> <p>追一个梦</p> <p>是的,不妨大胆一些!</p> </div> </div> </body> </html>