tags:

views:

86

answers:

3

I am trying to set the transparency of a table background color. But when i writes this code in css it shows me error "Validation (CSS2.1): filter is not a known property name" and same error for opacity.

Why so ?

.semiTransparent { filter: alpha(opacity = 50); opacity: 0.5; }

+2  A: 

The CSS Validator validates your style sheet against some profile, e.g. CSS Level 1 or CSS Level 2. Some browser Vendors however extend these profiles by new properties like Microsoft did with the scrollbar-base-color or filter property or Mozilla with the -moz-opacity property. The Validator is not aware of these properties and using them makes your style sheet invalid in terms of the CSS specifications. Either get rid of those properties or live with the fact, that your style sheets don't validate. You cannot have both.

http://www.websitedev.de/css/validator-faq :-)

meep
+1  A: 

filter is technically not a standard compliant property, it only works for IE. The opacity should be 0.5 not .5. Minor changes.

Michael
I am using IE 7 but still transparency effect is not reflecting.Moreover error is still persistant in CSS file
Shantanu Gupta
yupit works in mozilla but doesn't works with IEwhat can be done to resolve this problem
Shantanu Gupta
+1  A: 
raceCh-
i tried this code but this code is not working in IEbut working only in mozilla
Shantanu Gupta
As a matter of fact, filter property setting is considered ActiveX, so you must have them turned on or asked for. It works in other browsers without problems (opera, firefox, chrome, safari).
raceCh-