css3 - progress漸變效果css
問(wèn)題描述
請(qǐng)問(wèn)下圖中的這種漸變效果怎么寫(xiě)的?從橙色轉(zhuǎn)為紅色。#FFE669-#FA1A0A
問(wèn)題解答
回答1:不知道這樣是否滿足你的要求
<p id='progress'></p>
/*CSS3進(jìn)度條動(dòng)畫(huà)*/@keyframes progress{from {background-position: 0 0,0 0}to {background-position: 40px 0,0 0}}#progress{position:absolute;top:100px;left:100px;width:300px;height:20px;border-radius:10px; /*position/size/image的屬性值都是 第一組圖像,第二組圖像 第一組會(huì)覆蓋第二組,所以半透明的圖片可以放在第一組*/ background-position:0 0,0 0; background-size:40px 40px,100% 100%; background-image:linear-gradient(45deg,rgba(255,255,255,.5) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.5) 50%,rgba(255,255,255,.5) 75%,transparent 75%,transparent), linear-gradient(90deg,#FFE669, #FA1A0A); animation:progress 2s linear infinite;/*動(dòng)畫(huà)*/}
相關(guān)文章:
1. linux - Ubuntu下編譯Vim8(+python)無(wú)數(shù)次編譯失敗2. javascript - H5頁(yè)面怎么查看console信息?3. javascript - vscode alt+shift+f 格式化js代碼,通不過(guò)eslint的代碼風(fēng)格檢查怎么辦。。。4. javascript - webpack 報(bào)錯(cuò) 新人 求解5. python中怎么對(duì)列表以區(qū)間進(jìn)行統(tǒng)計(jì)?6. 前端 - CSS3 box-shadow如何設(shè)置,或者用什么方法可以產(chǎn)生圖中這樣陰影的效果。7. javascript - 寫(xiě)移動(dòng)端的頁(yè)面的時(shí)候,有不一快空白,是怎么回事?8. css - 移動(dòng)端 盒子內(nèi)加overflow-y:scroll后 字體會(huì)變大9. javascript - 用JS 七牛上傳圖片出現(xiàn)文件已存在的錯(cuò)誤(file exists)10. javascript - 如何判斷用戶切換到了當(dāng)前標(biāo)簽頁(yè)?
