按钮点击动态变化
<!DOCTYPE html> <html> <head> <style> .fansButton { width:87px; height:26px; background:rgba(229,38,25,1); border-radius:13px; display: flex; align-items: center; justify-content: center; color: #fff; transition: all .5s; } .fansButton:hover{ background: #fff; color: #999; border:1px solid rgba(215,215,215,1); } </style> <body> <div class='fansButton'> <span>关注</span> </div> </body> </html>