1
InternetExplorer Aug 9, 2018
不要用动画,用“过渡”就好了。
|
2
rabbbit Aug 9, 2018 <div></div>
<style> div {width: 200px;height: 150px;border: 1px solid black;transition: 1s;} div:hover {box-shadow: 0 0 20px 0px rgba(0,0,0,1)} </style> |
3
wxsm Aug 9, 2018
你这种应该用 transition,而不是 animation
|
4
rabbbit Aug 9, 2018 |
6
v2xiaolang Aug 9, 2018
学了多久到这了
|
7
CSGO OP @v2xiaolang 2 天了
|
8
whitegerry Aug 9, 2018
css3 动画选择 position、scale、rotation、opacity。
.banner { position: relative; flex: 1; height: 350px; background: rgba(0, 144, 255, 0.10); margin: 18px 10px; box-sizing: border-box; border-radius: 10px; } .banner::after { position: absolute; left: 0; top: 0; width: 100%; height: 100%; content: ''; border-radius: 10px; box-shadow: 0 8px 55px rgba(0, 0, 0, .12); opacity: 0; transition: opacity .3s; } .banner:hover::after { opacity: 1; } |
9
chenno9 Aug 9, 2018
你给 banner 写一个相反的动画,
@keyframes banner_animation1 { from { box-shadow: 0 8px 55px 0 rgba(0,0,0,0.12); } to { box-shadow: 0 0 0 0 rgba(0,0,0,0.00); } } #banner1,#banner2{ animation: banner_animation1 1s forwards; } |
10
rabbbit Aug 9, 2018
|