.className{ -webkit-animation: twinkling 1s infinite ease-in-out } .animated{ -webkit-animation-duration: 1s; animation-duration: 1s; -webkit-animation-fill-mode: both; animation-fill-mode: both } @-webkit-keyframes twinkling{ 0%{ opacity: 0.5; } 100%{ opacity: 1; } } @keyframes twinkling{ 0%{ opacity: 0.5; } 100%{ opacity: 1; } }
给class属性名为className的元素添加闪烁动画效果