要使用CSS創(chuàng)建脈沖效果,您可以嘗試運行以下代碼
示例
現(xiàn)場演示
<html> <head> <style> .animated { background-image: url(/css/images/logo.png); background-repeat: no-repeat; background-position: left top; padding-top:95px; margin-bottom:60px; -webkit-animation-duration: 10s; animation-duration: 10s; -webkit-animation-fill-mode: both; animation-fill-mode: both; } @-webkit-keyframes pulse { 0% { -webkit-transform: scale(1); } 50% { -webkit-transform: scale(1.1); } 100% { -webkit-transform: scale(1); } } @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } } .pulse { -webkit-animation-name: pulse; animation-name: pulse; } </style> </head> <body> <div id = "animated-example" class = "animated pulse"></div> <button onclick = "myFunction()">Reload page</button> <script> function myFunction() { location.reload(); } </script> </body> </html>
登錄后復(fù)制
以上就是使用 CSS 實現(xiàn)脈沖動畫效果的詳細內(nèi)容,更多請關(guān)注www.92cms.cn其它相關(guān)文章!