Opacity filters invalid

liunx

Guest
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;I've never used filters, so I don't know if this is valid, but check out this link. (<!-- m --><a class="postlink" href="http://msdn.microsoft.com/workshop/author/filter/filters.asp">http://msdn.microsoft.com/workshop/auth ... ilters.asp</a><!-- m -->)ok, i will... but that'd suck if they did.

to see the page i use the effect on go to <!-- m --><a class="postlink" href="http://projep.t35.com/a.php?a=gt">http://projep.t35.com/a.php?a=gt</a><!-- m --> 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 : }

<!-- m --><a class="postlink" href="http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fprojep.t35.com%2Fbg%2Fdefault.css&warning=1&profile=css2&usermedium=allAs">http://jigsaw.w3.org/css-validator/vali ... dium=allAs</a><!-- m --> 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.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?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.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...*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. ;)*Sigh* Just gimme a yes or a no, im really undecided on this.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!

JohnTurns out I decided. I took out the other two styles and the opacity rules and now I have valid CSS (woo!)While vendor specific exptensions are part of the CSS spec: <!-- m --><a class="postlink" href="http://www.w3.org/TR/CSS21/syndata.html#q4">http://www.w3.org/TR/CSS21/syndata.html#q4</a><!-- m -->
they are not recognized by the validator.
In this particular case I would not worry about the validator report since it's wrongToo late. Anyways, Paul was right they did look like links which might confuse some people.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.Can't help you, but I think they're proprietaty, and therefore, invalid.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.

Johni like having valid code, though, so i dont use it.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...

Johnas 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.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.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: <!-- m --><a class="postlink" href="http://www.w3.org/TR/CSS21/syndata.html#parsing-errors">http://www.w3.org/TR/CSS21/syndata.html#parsing-errors</a><!-- m -->
this would give desired results in both IE and compliant browsers, but won't be validated.I just like having something to show for it. Anyways, I don't need hacks- yet.They are not part of the W3C recommendations and therefore not valid.
There are many more browser specific extensions and proposed (<!-- m --><a class="postlink" href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/css/reference/attributes.asp">http://msdn.microsoft.com/library/defau ... ibutes.asp</a><!-- m -->) attributes that are not (yet) valid.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!!!heh, fang you're an insomniac too, huh?
No, you are forgetting the time-zonesOriginally 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. ;)Spot on :)Originally posted by Fang
Spot on :)
Oh, I'm good. :pValidators 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!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.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. ;)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.
 
Back
Top