關(guān)于CSS3 動畫transition的一個問題
問題描述
a{ color: #0088cc; text-decoration: none; &:hover, &:active, &:focus{color: orange;text-decoration: none;-webkit-transition: color 250ms ease-in 0ms;-moz-transition: color 250ms ease-in 0ms;-ms-transition: color 250ms ease-in 0ms;-o-transition: color 250ms ease-in 0ms;transition: color 250ms ease-in 0ms; }}
在alloyteam blog看到的一個效果。就是鼠標(biāo)移動到 a 連接上時,顏色是漸進變化的,移開鼠標(biāo)時也會有一個顏色漸變的效果,請問是怎樣做到的。
問題解答
回答1:a{ color: #0088cc; text-decoration: none; -webkit-transition: color 250ms ease-in 0ms; -moz-transition: color 250ms ease-in 0ms; -ms-transition: color 250ms ease-in 0ms; -o-transition: color 250ms ease-in 0ms; transition: color 250ms ease-in 0ms; &:hover, &:active, &:focus{color: orange; }}回答2:
a:link, a:visited, a:active {text-decoration: none;-webkit-transition: ...;-moz-transition: ...;-ms-transition: ...;-o-transition: ...;transition: text-shadow 500ms ease-in 0ms, color 500ms ease-in 0ms;}
transition: text-shadow 500ms ease-in 0ms, color 500ms ease-in 0ms;這一行中定義了指定兩個屬性的動畫:text-shadow跟color,你說的顏色漸進就是color 500ms ease-in 0m;可以理解為:執(zhí)行變化的屬性:color;動畫持續(xù)時間:500ms;時間函數(shù)(定義了執(zhí)行動畫的方式):ease-in(由慢到快);延遲時間:0m;
相關(guān)文章:
1. nignx - docker內(nèi)nginx 80端口被占用2. docker容器呢SSH為什么連不通呢?3. javascript - 連續(xù)點擊觸發(fā)mouseleave事件4. docker - 各位電腦上有多少個容器???容器一多,自己都搞混了,咋辦呢?5. 關(guān)于docker下的nginx壓力測試6. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””7. mac里的docker如何命令行開啟呢?8. docker gitlab 如何git clone?9. dockerfile - 我用docker build的時候出現(xiàn)下邊問題 麻煩幫我看一下10. angular.js使用$resource服務(wù)把數(shù)據(jù)存入mongodb的問題。

網(wǎng)公網(wǎng)安備