+4 votes
182 views
in Programming by (360 points)
edited by

i am trying this 

$(".cpick-s").css({
  "background": "-moz-linear-gradient(top, rgba(128,128,128,1) 0%,
   rgba(255,0,4,1) 100%)"
  "background": "-webkit-gradient(linear, left top, left bottom, 
  color-stop(0%,rgba(128,128,128,1)), color-stop(100%,rgba(255,0,4,1)))"
  "background": "-webkit-linear-gradient(top, rgba(128,128,128,1) 0%,
   rgba(255,0,4,1) 100%)"
  "background": "-o-linear-gradient(top, rgba(128,128,128,1) 0%,
   rgba(255,0,4,1) 100%)"
  "background": "-ms-linear-gradient(top, rgba(128,128,128,1) 0%,
   rgba(255,0,4,1) 100%)"
  "background": "linear-gradient(to bottom, rgba(128,128,128,1) 0%,
   rgba(255,0,4,1) 100%)"
  "background": "filter: progid:DXImageTransform.Microsoft.gradient
  (startColorstr='#808080', endColorstr='#ff0004',GradientType=0 )"
});
closed

1 Answer

+1 vote
by (1.3k points)
selected by
 
Best answer

you can use this in CSS

.gradient {
    background: -moz-linear-gradient(top, rgba(128,128,128,1) 0%, rgba(255,0,4,1) 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(128,128,128,1)), color-stop(100%,rgba(255,0,4,1)));
  background: -webkit-linear-gradient(top, rgba(128,128,128,1) 0%,rgba(255,0,4,1) 100%);
  background: -o-linear-gradient(top, rgba(128,128,128,1) 0%,rgba(255,0,4,1) 100%);
  background: -ms-linear-gradient(top, rgba(128,128,128,1) 0%,rgba(255,0,4,1) 100%);
  background: linear-gradient(to bottom, rgba(128,128,128,1) 0%,rgba(255,0,4,1) 100%);
  background: filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#808080', endColorstr='#ff0004',GradientType=0 );
}
 
.my-div {
    width:  50px;
    height: 50px;
}
}
$(function () {
    $('.my-div').addClass('gradient'); 
});
I hope you got the point.

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated