box-shadow的动效制作
突然发现原来box-shadow的功能很强大,还能做动效,下面整理下box-shadow几个效果
案例1:hover效果
<a href="/app/list">WEB小应用</a>
css:
#list_nav li a { height: 38px; display: block; width: 150px; background: #FFF; margin: 10px; text-decoration: none; border: 1px solid #2695F3; color: #fff; -moz-box-shadow: 200px 0 #2695F3 inset; box-shadow: 200px 0 #2695F3 inset; webkit-transition: box-shadow 0.3s; -moz-transition: box-shadow 0.3s; -o-transition: box-shadow 0.3s; transition: box-shadow 0.3s; border-radius: 5px; } #list_nav li a:hover { box-shadow: 5px 0 #2695F3 inset; color: #2695F3; margin-top: 10px; }
效果:
hover时: