漸變
來自專欄 PHP全棧開發
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width_=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> body{ background:black; } .box{ width:670px; height:419px; border: 1px solid #000; margin: 100px auto ; position: relative; overflow: hidden; } .box:before, .box:after{ content:""; width: 30px; height: 419px; position: absolute; top: 0px; left:-260px; /*background-color: yellowgreen;*/ background-image: linear-gradient( 90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1), rgba(255, 255, 255, 0) ); transform: skewX(-45deg); } .box:hover:before{ left: 800px; transition: all 1s; } .box:hover:after{ left:800px; transition: all 1s 0.5s; } </style></head><body> <div class="box"> <image src="images/1.jpg" alt=""> </div></body></html>
推薦閱讀:
※交互設計師容易犯哪些錯誤?
※為什麼買了遮光最好的窗帘還是睡不好?
※新春特輯 | 學設計後,該如何"優雅"的進食
※辦公桌面進化史,誰才是辦公桌上的主角?
※#設計 如何做一個字體包