<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>变大</title> </head> <style> .box{ width: 200px; height: 200px; margin: 200px auto; background: royalblue; animation: fangkuai 4s alternate infinite; } @keyframes fangkuai{ from{transform: scale(0);} to{transform: scale(1);} } </style> <body> <div class="box"></div> </body> </html>