Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I apply a CSS3 diagonal gradient?

I need to create such a button responsive:

enter image description here

I just came up with recreating it in css3, because when i embed it as image, it isn't responsive.

But as you can see, it only has a gradient on the top left side, so how do i realize it?

I used several gradient generators but none of them worked.

Hope you can help me.

like image 708
Fl0R1D3R Avatar asked Nov 16 '25 15:11

Fl0R1D3R


1 Answers

I found this, works great. http://www.colorzilla.com/gradient-editor/

I got some code which you can use as a template.

background: #1e5799; /* Old browsers */

background: -moz-linear-gradient(-45deg,  #1e5799 0%, #2989d8 50%, #207cca 63%, #7db9e8 100%); /* FF3.6+ */

background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,#1e5799), color-stop(50%,#2989d8), color-stop(63%,#207cca), color-stop(100%,#7db9e8)); /* Chrome,Safari4+ */

background: -webkit-linear-gradient(-45deg,  #1e5799 0%,#2989d8 50%,#207cca 63%,#7db9e8 100%); /* Chrome10+,Safari5.1+ */

background: -o-linear-gradient(-45deg,  #1e5799 0%,#2989d8 50%,#207cca 63%,#7db9e8 100%); /* Opera 11.10+ */

background: -ms-linear-gradient(-45deg,  #1e5799 0%,#2989d8 50%,#207cca 63%,#7db9e8 100%); /* IE10+ */

background: linear-gradient(135deg,  #1e5799 0%,#2989d8 50%,#207cca 63%,#7db9e8 100%); /* W3C */

filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
like image 171
Alfred Larsson Avatar answered Nov 18 '25 04:11

Alfred Larsson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!