要使用CSS 在Flex-grow 屬性上實作動畫,您可以嘗試執行下列程式碼
現場示範
<!DOCTYPE html> <html> <head> <style> .mycontainer { display: flex; background-color: red; align-content: space-between; } .mycontainer > div { background-color: white; text-align: center; line-height: 40px; font-size: 25px; width: 100px; margin: 5px; } div { animation: myanim 4s infinite; } @-webkit-keyframes myanim { 30% { flex-grow: 3; } } </style> </head> <body> <h1>Quiz</h1> <div class = "mycontainer"> <div style = "flex-grow: 1">A1</div> <div style = "flex-grow: 1">A2</div> <div style = "flex-grow: 20">A3</div> <div style = "flex-grow: 1">A4</div> <div style = "flex-grow: 1">A5</div> </div> </body> </html>
以上是動畫 CSS flex-grow 屬性的詳細內容。更多資訊請關注PHP中文網其他相關文章!