0

i use http://www.colorzilla.com/gradient-editor to generate css codes for a linear gradient background
i got what i needed from the website and here's my code

div{
width:450px;;
height:250px;
background: -moz-linear-gradient(top,  #eeeeee 50%, #cccccc 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(50%,#eeeeee), color-stop(100%,#cccccc)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  #eeeeee 50%,#cccccc 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  #eeeeee 50%,#cccccc 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  #eeeeee 50%,#cccccc 100%); /* IE10+ */
background: linear-gradient(to bottom,  #eeeeee 50%,#cccccc 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 ); /* IE6-9 */
}

the problem is it works for Chrome and i guess it will work for FF and most other browsers like Opera and Safari ..
the problem as always is, with IE (god cursed that bastard who invented IE and sent hem to hell)
even if i used filter: progid:DXImageTransform.Microsoft.gradient(My color rules) its not working
any suggestions folks ?

  • Please provide your code in the question. I think jsfiddle is in this case overkill. – willoller Aug 05 '13 at 20:22
  • 1
    Any version of IE in particular? – eclipsis Aug 05 '13 at 20:23
  • i have IE8 installed and IE7 standalone – amine dimaana Aug 05 '13 at 20:24
  • perhaps you should be a little less surprised that IE7/8 don't support CSS features very well that were only standardised in 2011. (IE8 was released in 2008). – Spudley Aug 05 '13 at 20:36
  • You might want to consider using [CSS3Pie](http://css3pie.com/) to add standardised support for some modern CSS features, including gradients, to older IE versions. You might also want to consider dropping IE7 support -- hardly anyone uses them. – Spudley Aug 05 '13 at 20:37
  • sorry everyone .. my code is correct .. the problem was in the css selector ! :nth-child(n) is not supported in IE8 and earlier ! – amine dimaana Aug 05 '13 at 20:37
  • @aminedimaana - hehe. yeah, that'll do it. – Spudley Aug 05 '13 at 20:39

1 Answers1

0
/* IE 7-*/         filter:                 progid:DXImageTransform.Microsoft.Gradient(startColorStr='#000000', endColorStr='#FFFFFF', GradientType=0);
/* IE 8+*/         -ms-filter:             "progid:DXImageTransform.Microsoft.Gradient(startColorStr='#000000', endColorStr='#FFFFFF', GradientType=0)";
/* IE 10+ */       background-image:       -ms-linear-gradient(top, #000000, #FFFFFF);
eclipsis
  • 1,541
  • 3
  • 20
  • 56
  • am sorry i think nothing is wrong with my first code i just tapped `background:red;` and didn't work .. it turned out that IE doesn't support the css selector i was using ! `:nth-child(n)` what should i do about that ! – amine dimaana Aug 05 '13 at 20:34