Click to See Complete Forum and Search --> : Opacity filters invalid


Ben Rogers
02-15-2004, 07:17 PM
These don't seem to validate, so I was wondering about them. I want valid CSS but I also want to use the filters

filter: alpha(opacity=80);
-moz-opacity: .8;

Paul Jr
02-15-2004, 07:25 PM
I've never used filters, so I don't know if this is valid, but check out this link. (http://msdn.microsoft.com/workshop/author/filter/filters.asp)

Ben Rogers
02-15-2004, 07:33 PM
ok, i will... but that'd suck if they did.

to see the page i use the effect on go to http://projep.t35.com/a.php?a=gt to see the effect, you'll have to scroll down. to see it.. works only in non sucky browsers i'm afraid cuz it uses img.rate:hover.. but these are all the error messages i get just from the two rules:

* Line: 0 Context : img.rate

Parse Error - opacity=80)
* Line: 0 Context : img.rate

Parse Error - -moz-opacity: 0.8;
* Line: 0 Context : img.rate

Parse error - Unrecognized : }
* Line: 0 Context : img.rate:hover

Parse Error - opacity=100)
* Line: 0 Context : img.rate:hover

Parse Error - -moz-opacity: 1;
* Line: 0 Context : img.rate:hover

Parse error - Unrecognized : }

http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fprojep.t35.com%2Fbg%2Fdefault.css&warning=1&profile=css2&usermedium=all

ray326
02-15-2004, 07:40 PM
As I said in another thread, AFAIK filters are not part of a CSS standard at this time. If you use non-standard CSS don't expect a standards-based validator to buy off on it.

Ben Rogers
02-15-2004, 07:46 PM
Originally posted by ray326
As I said in another thread, AFAIK filters are not part of a CSS standard at this time. If you use non-standard CSS don't expect a standards-based validator to buy off on it.

AFAIK? What's that? And so you're saying unless I get rid of the opacity stuff I'm doomed to have invalid CSS?

Paul Jr
02-15-2004, 07:52 PM
Originally posted by omega
AFAIK? What's that?
As Far As I Know.

Originally posted by omega
And so you're saying unless I get rid of the opacity stuff I'm doomed to have invalid CSS?
Yes.

Ben Rogers
02-15-2004, 07:58 PM
OK, could you do me a favor? Go to the page (link posted above) and scroll down and put your mouse over the ratings images. Tell me if the effect is a good one. Because if it isn't then I might as well take out the opacity rules, and since I deleted the other styles (gonna make 1 for st. patty's day...) I could actually put "Valid CSS" and have it be true...

Paul Jr
02-15-2004, 08:01 PM
*Shrug* I dunno. Kinda makes 'em look like links. Also, ya might wanna align 'em all nice and flush with each other to the right. ;)

Ben Rogers
02-15-2004, 08:10 PM
*Sigh* Just gimme a yes or a no, im really undecided on this.

Bigjohn
02-15-2004, 09:11 PM
Originally posted by omega
*Sigh* Just gimme a yes or a no, im really undecided on this.
If you look at w3c.org, they do include FILTER as part of CSS2... at least that's where I saw it first!

John

Ben Rogers
02-15-2004, 09:20 PM
Turns out I decided. I took out the other two styles and the opacity rules and now I have valid CSS (woo!)

Vladdy
02-15-2004, 09:24 PM
While vendor specific exptensions are part of the CSS spec: http://www.w3.org/TR/CSS21/syndata.html#q4
they are not recognized by the validator.
In this particular case I would not worry about the validator report since it's wrong

Ben Rogers
02-15-2004, 09:28 PM
Too late. Anyways, Paul was right they did look like links which might confuse some people.

ray326
02-15-2004, 10:08 PM
I'm sorry folks but I find ZERO references to "filter" on the W3C site except in the context of scalable vector graphics. Please someone give me a relevent pointer to "filter" withing the context of CSS, preferably within the documents defining CSS 2, 2.1 or 3.

Ben Rogers
02-15-2004, 10:20 PM
Can't help you, but I think they're proprietaty, and therefore, invalid.

Bigjohn
02-15-2004, 10:39 PM
Originally posted by ray326
I'm sorry folks but I find ZERO references to "filter" on the W3C site except in the context of scalable vector graphics. Please someone give me a relevent pointer to "filter" withing the context of CSS, preferably within the documents defining CSS 2, 2.1 or 3.

as vladdy indicated, they're vendor specific extensions, and both IE and MOZ (which count for 97% of all hits on my websites - by the way IE accounts for about 96% of all browsers (including AOL branded IE, Earthlink branded IE.. etc)... so using something that hits 98% is good enough for me.

John

Ben Rogers
02-15-2004, 10:50 PM
i like having valid code, though, so i dont use it.

Bigjohn
02-15-2004, 10:59 PM
Originally posted by omega
i like having valid code, though, so i dont use it.

Like it or not, every 'standard' started out as something proprietary.... long time ago, there were steam powered cars.... internal combustion was one guys idea... it became a standard...

John

ray326
02-15-2004, 11:00 PM
as vladdy indicated, they're vendor specific extensions, and both IE and MOZ (which count for 97% of all hits on my websites - by the way IE accounts for about 96% of all browsers (including AOL branded IE, Earthlink branded IE.. etc)... so using something that hits 98% is good enough for me.
And that's fine; I thumb my nose at people with no Javascript. But there are defined protocols for vendor extensions per Vladdy's pointer and even the old "well they're MICROSOFT so we'll let them off the hook" bit but I see nothing that allows for the filter: line or the alpha parameter. The -moz- parameter is to spec as usual. The bottom line is you can do whatever you damned well want to but you can't expect the result to be blessed by a standards-based syntax validator.

Ben Rogers
02-15-2004, 11:11 PM
I listen to what the validator tells me, lol. It's just my way of proving I have an actual webpage here, not just peice of crap, on coding point.

Vladdy
02-15-2004, 11:28 PM
Validators are tools that help you create a good web page, not a religion you should have blind faith in.
Understanding what the errors and warnings are and what do they mean for your web page - that is the important thing.
There are too many proprietory things in CSS and many hacks that you have to use to make a cross-browser presentation that make validated CSS impossible. The example that comes to mind is the "pointer" cursor IE hack:
cursor: pointer;
cursor: hand;
According to CSS parsing rules: http://www.w3.org/TR/CSS21/syndata.html#parsing-errors
this would give desired results in both IE and compliant browsers, but won't be validated.

Ben Rogers
02-15-2004, 11:42 PM
I just like having something to show for it. Anyways, I don't need hacks- yet.

Fang
02-16-2004, 02:07 AM
They are not part of the W3C recommendations and therefore not valid.
There are many more browser specific extensions and proposed (http://msdn.microsoft.com/library/default.asp?url=/workshop/author/css/reference/attributes.asp) attributes that are not (yet) valid.

Ben Rogers
02-16-2004, 02:12 AM
yep, that's what i thought proprietary crap.

heh, fang you're an insomniac too, huh?

offtopic (so don't reply): check my site right now, i made my first script!!! "Login" and then go to another page to another page, the cookie will be activated. It's awesome!!!

Fang
02-16-2004, 03:01 AM
heh, fang you're an insomniac too, huh?
No, you are forgetting the time-zones

Paul Jr
02-16-2004, 03:12 AM
Originally posted by Fang
No, you are forgetting the time-zones
It's probably like... around 9 in the morning maybe? I'm not real good with time-zones. ;)

Fang
02-16-2004, 03:15 AM
Spot on :)

Paul Jr
02-16-2004, 03:23 AM
Originally posted by Fang
Spot on :)
Oh, I'm good. :p

ray326
02-16-2004, 10:09 AM
Validators are tools that help you create a good web page, not a religion you should have blind faith in.
Understanding what the errors and warnings are and what do they mean for your web page - that is the important thing.
Right on!

Ben Rogers
02-16-2004, 12:35 PM
Well, chances are if you're drawing up a tonnage of errors, then you screwed up, so it's good to pay attention to it in my opinion.

Paul Jr
02-16-2004, 05:04 PM
Originally posted by omega
Well, chances are if you're drawing up a tonnage of errors, then you screwed up, so it's good to pay attention to it in my opinion.
True. But just because your site validates XHTML 1.1, doesn't mean it will display properly or function. ;)

Ben Rogers
02-16-2004, 05:41 PM
True. I'm redoing my CSS all the way so that it looks normal in both Mozilla and IE, as well as legible in 800*600. Going along nicely.