我正在 Firefox 33 上测试我的应用程序。我有一个用渐变定义的简单背景属性:
background: linear-gradient(bottom, #004771 0%, #005185 100%);
而且它不起作用。 <强> CanIUse 报告说 Firefox 33 上的渐变可以在没有前缀的情况下使用。那么为什么它不起作用?如果我添加特定于 Mozilla 的前缀:
background: -moz-linear-gradient(bottom, #004771 0%, #005185 100%);
一切正常。
最佳答案
使用没有前缀的linear-gradient时,需要这样写(“to bottom”而不是“bottom”):
background: linear-gradient(to bottom, #004771 0%, #005185 100%);
编辑:文档链接:https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient#Syntax
关于css - 为什么我的线性渐变在 Firefox 中不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27548447/