Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

right border gradient

Tags:

html

css

I am trying to make right border of an <ul> element to be linear gradient.
I have tried following but with no success:

-webkit-border-image: -webkit-linear-gradient(top, #FE2EF7, #4AC0F2) 0 0 5px;

I am using Chrome.
Many thanks

like image 437
daniel.tosaba Avatar asked Aug 13 '11 11:08

daniel.tosaba


People also ask

How do you make a border gradient?

The border-image property can accomplish this. You'll need to specify border-style and border-width too. border-image: linear-gradient(#f6b73c, #4d9f0c) 30; border-width: 4px; border-style: solid; Read more on MDN.

Can a border have a gradient?

To show gradients for a border with CSS you can use the border-image property. It allows setting gradient values in the same way as the background-image property. Besides the border-image property, you should specify additional properties to actually show border gradient.

What are the three types of gradients?

You can choose between three types of gradients: linear (created with the linear-gradient() function), radial (created with the radial-gradient() function), and conic (created with the conic-gradient() function).

Can we use linear gradient in border?

The first linear gradient is limited to the padding box (i.e., all the content of the element, except the borders).


1 Answers

There is a solution for that but I'm not sure you can adjust the border width: http://jsfiddle.net/u2ZE4/1/

-webkit-border-image: -webkit-gradient(linear, left top, left bottom, from(#e00), to(#fff))0 100% 0 0 stretch;
like image 116
Andreas Köberle Avatar answered Oct 20 '22 00:10

Andreas Köberle