Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I apply webkit-gradient to a border or just background?

Tags:

html

css

So I would like to make the border faded. I have the exact webkit-gradient settings that I want.

But not sure how to implement it on the border element.

Is it possible? How do I do that?

Only CSS3 please.

Btw, I tried the following CSS and it didn't work:

border-color: -webkit-gradient( linear, left bottom, left top, color-stop(0.74, rgb(214,11,11)), color-stop(0.39, rgb(175,13,13)), color-stop(0.07, rgb(157,22,22)));
    border-style: solid;
    border-width: 10px;
like image 760
marcamillion Avatar asked Sep 29 '10 22:09

marcamillion


2 Answers

Yes, you can apply -webkit-gradient to a border:

-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;

(from this example on webkit.org)

See the blog post on Webkit.org about -webkit-gradient

like image 56
Josh Leitzel Avatar answered Oct 05 '22 23:10

Josh Leitzel


http://www.cssportal.com/css3-preview/borders.htm Nice little article

like image 26
Ascherer Avatar answered Oct 05 '22 23:10

Ascherer