CSS3 过渡效果
我最近对 CSS3 进行了大量的研究,并且我做了一个设计只是为了好玩,其中包含了大量不必要的功能和效果。这里是:
http://wendyhenrichs.com/could/
如果您看一下我的导航栏:在顶部,您会注意到,当您将鼠标悬停在链接上时,它会以平滑的过渡动作向右移动 7 个像素。
但请注意,当您将鼠标从链接上移开时,它会立即跳回到原来的位置。
有没有办法让它以平滑的动作淡出回到原来的位置,就像之前移动的那样?
I have recently been studying up a ton on CSS3, and I've made a design just for fun with a ton of unnecessary features and effects. Here it is:
http://wendyhenrichs.com/could/
If you take a look at my navigation bar at the top, you'll notice that when you hover over a link, it moves 7 pixels to the right in a smooth, transition motion.
But then notice, when your take your mouse off the link, it will just immediately hop back into its original position.
Is there any way to make it fade back into position in a smooth motion, as it moved before?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,有一种方法..给它一个
position
来转换回默认的
a
上已经有的转换,所以只需设置nav a
s相对位置回到0;它也需要position:relative
,所以如果你只是将position:relative
放在默认状态上,那么你只需操作悬停状态上的左坐标工作示例:此处
Yes there's a way.. give it a
position
to transition back toyou already have the transition on the default
a
so just set thenav a
s relative position to back to 0; it will needposition: relative
too, so if you just putposition: relative
on the default state, then you just manipulate the left co-ordinate on the hover stateWorking Example: HERE