Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts

    CSS opacity tags - won't validate

    Hi guys!

    When I try to validate my CSS ( http://www.xflightx.port10.com/style.css )
    I get following errors in the W3C validator: ( LINK)
    95 #dropmenudiv Parse Error - opacity=70)
    96 #dropmenudiv Property -moz-opacity doesn't exist : 0.7
    97 #dropmenudiv Property opacity doesn't exist : 0.7
    How would I correct it?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,678
    Thanks
    6
    Thanked 1,009 Times in 982 Posts
    You can’t correct code that isn’t part of any standards in the first place. And the filter property is an invention of Micorsoft while -moz-opacity obviously is a Mozilla-only code. You will never get them to validate according to W3C standards, you can only get rid of them at all.

    The opacity property, however, will be valid when the CSS 3 specifications are official. Until then the validator of course will say it’s not valid because it isn’ yet part of any official standards.

  • #3
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    Okay, thanks! Also, do you have any clue about when the new standards are official?

  • #4
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    Quote Originally Posted by VIPStephan View Post
    The opacity property, however, will be valid when the CSS 3 specifications are official. Until then the validator of course will say it’s not valid because it isn’ yet part of any official standards.
    Fwiw, the W3C CSS validator offers the facility to validate according to the CSS3 spec, at least tentatively.

    Click on 'More Options' and select CSS3 from the profiles menu.
    Last edited by Bill Posters; 08-09-2007 at 08:19 PM.

  • #5
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    Thanks for that, Bill. But it still won't validate fully..heck, I can live with it..

  • #6
    Senior Coder
    Join Date
    Feb 2003
    Posts
    1,665
    Thanks
    0
    Thanked 27 Times in 25 Posts
    So long as you're using proprietary CSS, you're unlikely to get it 100% valid.

    Line #95: filter:alpha(opacity=70);
    As far as the IE filter opacity property goes, you could implement an additional IE-specific stylesheet after the main stylesheet via conditional comments.

    Line #96: -moz-opacity:0.7;
    The moz-specific one can almost certainly be ditched. Recent versions of Gecko-based UAs should support the CSS3 opacity property natively. (Users with Gecko-based UAs typically update more regularly than those who use the default browsers which come with their OS.)


    By removing the moz property and shifting the IE property to its own stylesheet, you should be left with a 100% valid main stylesheet.

  • #7
    Regular Coder
    Join Date
    Jun 2007
    Posts
    805
    Thanks
    123
    Thanked 23 Times in 23 Posts
    Bill, thanks! I'll try it out!

  • #8
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,641
    Thanks
    0
    Thanked 649 Times in 639 Posts
    CSS codes starting with - are supposed to indicate that they are proprietary to a particular browser although for some reason the validator doesn't recognise this.

    -moz-something for Mozilla based browsers
    -khtml-something for KHTML based browsers
    -op-something for Presto based browsers
    -ie-something for Trident based browsers

    although Microsoft would never consider implementing their proprietary CSS using the standard notation intended for the that purpose and so the last one doesn't actually exist.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #9
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by felgall View Post
    although Microsoft would never consider implementing their proprietary CSS using the standard notation intended for the that purpose and so the last one doesn't actually exist.
    That's just trying to make MS look bad. All of the proprietary IE extensions which don't use the hyphen or underscore option predate CSS2.1 (which is where the option of using a hyphen or underscore for vendor specific extensions comes from). -ms- is used for proprietary extensions added after it was added to the CSS2.1 WD. And they can't change those that don't use a hyphen or underscore without breaking backwards compatibility.

    In this case, filter was introduced with IE4/Win, released when CSS1 was the current standard. I challenge you to find anything in the CSS1 spec saying they should use the above notation.
    Last edited by gsnedders; 08-10-2007 at 11:26 PM.

  • #10
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,641
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Microsoft don't need help to look bad. They had a perfect opportunity to introduce support for CSS2.1 into IE7 and they didn't. They could also introduce the hyphenated proprietary styles as alternatives to their invalid versions too for those people who want to use valid CSS but they haven't done that either. IE7 is so far out of date that all the other browser writers have produced at least two new versions since they had one that was that far behind the current standards. The sooner IE10 is release the better as judging by past performance that will be the version that supports the 2007 standards but it probably wont be released until 2017 if ever. Still with the rapid fall in people using IE instead of a standards compliant browser we probably wont have to worry about IE at all in a few years time.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #11
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Quote Originally Posted by felgall View Post
    Microsoft don't need help to look bad. They had a perfect opportunity to introduce support for CSS2.1 into IE7 and they didn't.
    Yet they made more progress towards CSS2.1 support than any other browser did during the time IE7 was under development.

    Quote Originally Posted by felgall View Post
    They could also introduce the hyphenated proprietary styles as alternatives to their invalid versions too for those people who want to use valid CSS but they haven't done that either.
    What makes you think that they are valid? The spec says you're only allowed to use properties defined within the spec. The fact it documents an option (which, under RFC 2119 language, is all it is) for keywords for vendor specific extensions is irrelevant.

    I wouldn't be surprised if IE.next had CSS 2.1 support equal to other browsers. Other issues like DOM are far more volatile, as far more pages would break if the behaviour there is changed. I'm not really sure how you expect a browser that wasn't even developed for several years (from 2001 to 2005) to be equal on standards to those that have been under development continuously.
    Last edited by gsnedders; 08-11-2007 at 02:20 PM.

  • #12
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,641
    Thanks
    0
    Thanked 649 Times in 639 Posts
    I don't expect a browser that was abandoned for several years to be equivalent to ones under constant development. The point is that Microsoft abandoned their browser and even the latest version is so far behind the standards that it requires special coding to get it to display pages the same as modern standard compliant browsers do. By the time that there is an IE version that supports CSS2.1 the other browsers will probably support CSS3.

    It would also be extremely useful if Microsoft would add support for JavaScript into IE as it is currently the only major browser that doesn't support it. That would then avoid the need to write code to test if the browser is running JavaScript or JScript in order to use the appropriate DOM calls that the two different languages use.

    Fortunately the percentage of people using IE instead of modern browsers is rapidly falling and it will soon be a minority browser as well as a non-standard one.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #13
    Regular Coder Jutlander's Avatar
    Join Date
    Jun 2007
    Location
    In my own sick little world :P
    Posts
    425
    Thanks
    1
    Thanked 12 Times in 12 Posts
    Eh, IE does support Javascript.
    .
    .

  • #14
    New Coder
    Join Date
    Jun 2007
    Posts
    60
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Why bother validating if something works as you want it? If it works perfectly, no need to take the piss of validating the code.

  • #15
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,678
    Thanks
    6
    Thanked 1,009 Times in 982 Posts
    Quote Originally Posted by MHaris View Post
    Why bother validating if something works as you want it? If it works perfectly, no need to take the piss of validating the code.
    Yeah, of course… why bother using semantic HTML and CSS to create websites when tables worked as well? Why bother making progress in something when old ways were working, too? Why bother learning new things when you had an easy living being stupid before?

    Any more stupid and useless advice?


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •