运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <head> <style> #main { width: 350px; height: 100px; border: 1px solid #c3c3c3; display: flex; } #main div { flex-grow: 1; flex-shrink: 1; flex-basis: 300px; } #myBlueDiv { animation: mymove 5s infinite; } @keyframes mymove { 50% {flex-shrink: 8;} } </style> </head> <body> <h1>Animation of flex-shrink</h1> <p>Gradually change the flex-shrink property of the "blue DIV" from 1 to 8, and back to 1:<p> <div id="main"> <div style="background-color:coral;">Red DIV</div> <div style="background-color:lightblue;" id="myBlueDiv">Blue DIV</div> </div> </body> </html>