chefcurry7 chefcurry7 - 1 month ago 6
HTML Question

CSS gradient background on div

How do I get A similar style to the below active div? It seems that the color is kind of fading.

enter image description here

Answer

You can use linear-gradient for that, as it is described here. You can do the following:

.hoverable:hover {
  background: -webkit-linear-gradient(white, lightgray);
  background: -moz-linear-gradient(white, lightgray);
  background: -o-linear-gradient(white, lightgray);
  background: linear-gradient(white, lightgray);
}

You can check a demo on this Fiddle