/    Sign up×
Community /Pin to ProfileBookmark

annoying FF alert for CSS IE filter

I use the sequence:

[code]
.someclass{
-moz-opacity:0;
opacity: 0;
filter:alpha(opacity:0);
}
[/code]

I have 2 problems:

  • 1.

    While IE ignores the [I]-mox-opacity[/I] attribute, FF’s console shows an annoying error when reaching the IE’s [I]filter[/I] attribute. Is there a way to “jump over” or to “escape” the IE attribute somehow, to avoid the error message? Of course, the page loads OK, but I hate that error message (and I have a very scrupulous client ? who wants his pages to be absolutely valid).

  • 2.

    I guess Opera will not overpass the IE’s attribute, and it will even stop reading the code (I am not sure, I have no Opera right now to check). If so, the same question, is there a way to make Opera ignore the IE’s attribute [I]filter[/I]?

  • (whitout mentioning that the CSS validator says -moz-opacity is not correct – which means that I sould escape that, as well? ? ).

    I hate to do that, but if no alternative I could use javascript to give those elements the opacity attributes. Or persuade my client that there is no reasonable way to avoid the console’s error…

    By short I need a sort of browser detector code/way in CSS (yet I think there is no such of )

    to post a comment
    CSS

    5 Comments(s)

    Copy linkTweet thisAlerts:
    @VladdyAug 23.2006 — I have a server side CSS preprocessor written in PHP that will deliver browser specific code: raw stylesheet: http://www.klproductions.com/styles/screen.xcss and processed one: http://www.klproductions.com/klcsspp/klcsspp.php?file=../styles/screen.xcss

    That is a sure way to keep validators happy ? ? ?
    Copy linkTweet thisAlerts:
    @KorauthorAug 23.2006 — Oh, I was just thinking of some server solution, so that I guess that your ideea is exactly what I need. Thank you very much!
    Copy linkTweet thisAlerts:
    @KravvitzAug 23.2006 — User-agent strings are unreliable and can be spoofed. This was discussed somewhere a few months ago, but unfortunately I can't seem to find that thread again.

    I suggest you use conditional comments to make an IE-only stylesheet.

    Just remember that only IE5+/Win supports them.

    [url=http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp]About Conditional Comments[/url]

    [url=http://www.positioniseverything.net/articles/multiIE.html]Some more information on conditional comments can be found on this page.[/url]

    [url=http://www.quirksmode.org/css/condcom.html]QuirksMode.org : Conditional comments[/url]

    http://www.google.com/search?q=IE+conditional+comment
    Copy linkTweet thisAlerts:
    @VladdyAug 24.2006 — This whole "UA Strings can be spoffed" argument does not hold water. The purpose of UA string is to provide server with information about user agent and its capabilities. If you are spoofing the UA string, guess what, that is YOUR problem, not mine (if you present pharmacy with a falsified prescription and then croak on the medicine, is it pharmacy's fault???).
    Copy linkTweet thisAlerts:
    @toicontienAug 24.2006 — Heh. ? I kind of like that argument. "Thinning of the herd" as I'd say. But I [i]am[/i] a bit of a Social Darwinist ?
    ×

    Success!

    Help @Kor spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.14,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...