为什么该animation
属性不适::selection
用于 CSS 中的选择器?
基本测试用例:
@keyframes frames{
50%{ color:red }
}
@-webkit-keyframes frames{
50%{ color:red }
}
::selection { background:#EEE; animation:0.4s frames infinite; }
::-moz-selection { background:#EEE; animation:0.4s frames infinite; }
::-webkit-selection{ background:#EEE; -webkit-animation:0.4s frames infinite; }
<h2>Selected text should be animated:</h2>
CSS3 animations make it possible to animate transitions from one CSS style configuration to another. Animations consist of two components, a style describing the CSS animation and a set of keyframes that indicate the start and end states of the animation's style, as well as possible intermediate waypoints along the way.