1

Here's what I'm trying to do: http://jsfiddle.net/wLyqvrn1/1/

table {
  height: 200px;
    width: 200px;
  background-color: #444557; /* this doesn't show below the gradient */

  /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,ffffff+100&0.1+0,0.1+100 */
  background: -moz-linear-gradient(top, rgba(0,0,0,0.1) 0%, rgba(255,255,255,0.1) 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0.1)), color-stop(100%,rgba(255,255,255,0.1))); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(top, rgba(0,0,0,0.1) 0%,rgba(255,255,255,0.1) 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(top, rgba(0,0,0,0.1) 0%,rgba(255,255,255,0.1) 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(top, rgba(0,0,0,0.1) 0%,rgba(255,255,255,0.1) 100%); /* IE10+ */
  background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%,rgba(255,255,255,0.1) 100%); /* W3C */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1a000000', endColorstr='#1affffff',GradientType=0 ); /* IE6-9 */
}
switz
  • 24,384
  • 25
  • 76
  • 101
  • possible duplicate of [Is it possible to combine a background image and CSS3 gradients?](http://stackoverflow.com/questions/2504071/is-it-possible-to-combine-a-background-image-and-css3-gradients) – Jonathan Aug 31 '15 at 17:37
  • 1
    Just change your gradients declaration from background to background-image – vals Aug 31 '15 at 17:39
  • @vals Sweet! That works! Feel free to add it as an answer. – switz Aug 31 '15 at 17:40
  • @vals You should post it as an answer since it isn't really a duplicate. – Jonathan Aug 31 '15 at 18:02

1 Answers1

0

Even though there is an answer to and older question about this, maybe it is better to add some more thorough explanation.

background-color is one of the properties inside background

When you set

background: linear-gradient(...);

even thought it looks like you are not changing background-color, you are doing so !

background expands to all of its properties, and then resets them (also because it is defined later than background-color)

vals
  • 61,425
  • 11
  • 89
  • 138