在工做中,常常有一些须要切换的交互样式。若是直接在两种状态之间切换,就显得有点生硬。加上一些动画效果就会好不少。css
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width=14 height=7 > <polygon points="0,0 14,0 7,7" style={{ fill: '#999', stroke: '#999', strokeWidth: 1 }} /> </svg>
animation: up 0.5s; @keyframs up { from { transform: rotate(0deg); } to { transform: rotate(180deg); } }