CSS3渐变边界(Gradient borders)

编程入门 行业动态 更新时间:2024-10-26 14:28:43
CSS3渐变边界(Gradient borders)

我试图对边框应用渐变,我以为这样做很简单:

border-color: -moz-linear-gradient(top, #555555, #111111);

这不行,有人知道边界渐变的正确方法是什么。

I'm trying to apply a gradient to a border, I thought it was as simple as doing this:

border-color: -moz-linear-gradient(top, #555555, #111111);

But this does not work.

Does anyone know what is the correct way to do border gradients?

最满意答案

WebKit现在(至少Chrome 12)支持渐变作为边框图像:

-webkit-border-image: -webkit-gradient(linear, left top, left bottom, from(#00abeb), to(#fff), color-stop(0.5, #fff), color-stop(0.5, #66cc00)) 21 30 30 21 repeat repeat;

Prooflink - http://www.webkit.org/blog/1424/css3-gradients/ 浏览器支持: http : //caniuse.com/#search=border-image

WebKit now (and Chrome 12 at least) supports gradients as border image:

-webkit-border-image: -webkit-gradient(linear, left top, left bottom, from(#00abeb), to(#fff), color-stop(0.5, #fff), color-stop(0.5, #66cc00)) 21 30 30 21 repeat repeat;

Prooflink -- http://www.webkit.org/blog/1424/css3-gradients/ Browser support: http://caniuse.com/#search=border-image

更多推荐

本文发布于:2023-08-02 16:23:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1378725.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:边界   borders   Gradient

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!