Loading ...
Sorry, an error occurred while loading the content.

CSS @charset declaration in JSLint.

Expand Messages
  • pauanyu
    /* I m a comment! */ @charset UTF-8 ; [hidden] { display: none !important; } The above is valid JSLint, but fails in the W3 CSS validator with the following
    Message 1 of 2 , Aug 18, 2009
    • 0 Attachment
      /* I'm a comment! */
      @charset "UTF-8";
      [hidden] {
      display: none !important;
      }


      The above is valid JSLint, but fails in the W3 CSS validator with the following error:

      The @charset rule may only occur at the start of the style sheet. Please check that there are no spaces before it. @charset "UTF-8";


      In addition, I was reading this link:

      http://www.w3.org/International/questions/qa-css-charset

      It says, "Only one @charset rule may appear in an external style sheet and it must appear at the very start of the document. It must not be preceded by any characters, not even comments."

      Note the part about "not even comments."
    • Douglas Crockford
      ... Thanks. Please try it now.
      Message 2 of 2 , Aug 18, 2009
      • 0 Attachment
        --- In jslint_com@yahoogroups.com, "pauanyu" <pcxunlimited@...> wrote:
        >
        > /* I'm a comment! */
        > @charset "UTF-8";
        > [hidden] {
        > display: none !important;
        > }
        >
        > http://www.w3.org/International/questions/qa-css-charset
        >
        > It says, "Only one @charset rule may appear in an external style sheet and it must appear at the very start of the document. It must not be preceded by any characters, not even comments."


        Thanks. Please try it now.
      Your message has been successfully submitted and would be delivered to recipients shortly.