CSS3新增動畫屬性,transition(過渡)屬性介紹,其做用就是:平滑的改變CSS的屬性值javascript
transition 屬性是一個簡寫屬性,用於設置四個過渡屬性:css
簡寫屬性,transition:all 1s 3s linear; //PS:all全部的css屬性都擁有過渡,過渡時間爲1s,延遲3s觸發動畫,執行勻速觸發函數。html
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <style> .trans { -webkit-transition: all 3s 2s linear; -moz-transition: all 3s 2s linear; -ms-transition: all 3s 2s linear; -o-transition: all 3s 2s linear; transition: all 3s 2s linear; /*全部CSS屬性都擁有過渡屬性,動畫持續時間3s 延遲2s觸發 linear的觸發函數*/ } .trans:hover { background-color: #486AAA; /*背景色+顏色擁有過渡屬性值*/ color: #fff; } </style> </head> <body> <a class="trans" href="javascript:void(0);">動態a數據</a> </body> </html>