【发布时间】:2011-03-10 01:18:09
【问题描述】:
我正在尝试在支持渐变的浏览器中制作闪亮的按钮,但在 Firefox 中从未得到我想要的外观。该图像显示了它们在 chrome/safari 中的外观(这是我所追求的),但我无法弄清楚如何在 Firefox 中获得明显的反射线(当然是 3.5+)。
http://karmatics.com/stuff/shiny.pnghttp://karmatics.com/stuff/shinycss3button.html
下面是 webkit 代码(用于渐变),我想完全匹配 Firefox 中的外观。对于 CSS 的其余部分(包括我在 Mozilla 中的糟糕尝试,这对我的口味来说不够光滑),请查看页面上的源代码。
(顺便说一句,如果有人想让它在 IE 中也看起来不错,我会很高兴,但不要屏住呼吸 :))
编辑:Mozilla 答案现在就在里面(也在上面的链接中)
<style>
div.shiny {
background-image:
-webkit-gradient(
linear, 0% 0%, 0% 100%,
from(rgba(255,255,255,0.5)),
to(rgba(255,255,255,0.2)),
color-stop(.5,rgba(255,255,255,0.3)),
color-stop(.5,rgba(255,255,255,0.0))
);
background-image:
-moz-linear-gradient (top,
rgba(255,255,255,0.5),
rgba(255,255,255,0.3) 50%,
rgba(0,0,0,0.0) 50%,
rgba(255,255,255,0.2));
}
</style>
【问题讨论】: