CSS 转换不起作用?
由于某种原因,我似乎无法让 css 转换正常工作。我确信这是一个非常简单的错误。但我已经把头撞在墙上一个小时了。我在 Windows 7 64 位上使用 mozilla firefox 4.0.1。
<style>
a:link {
transition: color 1s ease-in-out;
color: #fff;
text-decoration: none;
text-shadow: 1px 1px #000;
}
a:hover {
color: #0072bc;
text-decoration: none;
text-shadow: 1px 1px #000;
}
</style>
<a href="#">test</a>
I cannot seem to get css transitions to work for some reason. I am sure this is a very simple mistake. But I have been hitting my head against the wall for an hour now. I am using mozilla firefox 4.0.1 on windows 7 64bit.
<style>
a:link {
transition: color 1s ease-in-out;
color: #fff;
text-decoration: none;
text-shadow: 1px 1px #000;
}
a:hover {
color: #0072bc;
text-decoration: none;
text-shadow: 1px 1px #000;
}
</style>
<a href="#">test</a>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
css 转换是实验性的,但在某些引擎中实现了。
您需要使用特定属性:
css transition is experimental, but implemented in some engines.
You need to use the specific properties :
您需要使用
-moz-
前缀,因为它尚未标准化。所以:You need to use the
-moz-
prefix, as it isn't standardised yet. So:这也可以使用 jquery / jquery ui 来完成,所以我可以在所有浏览器中工作 =)
http://docs.jquery.com/UI/Effects/ClassTransitions
this can be also done with jquery / jquery ui so i got working in all browsers here =)
http://docs.jquery.com/UI/Effects/ClassTransitions
您应该研究一下用于 CSS 创作的 SASS 框架。您不必担心实验依赖性,因为框架会为您处理所有这些事情。
You should look into the SASS framework for CSS authoring. You will not have to worry about experimental dependencies as the framework takes care of all that for you.