0

I want to apply drop shadow filter only if the input type is Checkbox. Following is working

input {     
    filter: expression("progid:DXImageTransform.Microsoft.Alpha(opacity=100)");
}

However I want to include this.type=='checkbox' in it. Some thing like this

input {
    filter: expression(this.type=='checkbox' ? "progid:DXImageTransform.Microsoft.Alpha(opacity=100)":"");
}

This does not work.

Knu
  • 14,806
  • 5
  • 56
  • 89
user420054
  • 65
  • 4
  • 14

1 Answers1

6

You should only use expression if there is no other choice.

Try this instead:

input[type="checkbox"] { 
    filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100);
}

This is using the attribute selector.

You also said you're trying to apply a drop shadow - you'll have to change that Alpha filter to the DropShadow one.

thirtydot
  • 224,678
  • 48
  • 389
  • 349
  • Unfortunately we are not using doctype to be able to use attribute selector of css. – user420054 Apr 20 '11 at 23:48
  • Ah. Quirks Mode is a problem. I'll have a think and see if I can come up with an alternative, or a way to fix your original snippet. – thirtydot Apr 21 '11 at 00:25