SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Location
    Melbourne, Australia
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cool validation of CSS

    I have been trying to get my CSS page validated, but they keep coming up with the following error no matter what I do -

    7 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";

    There are no gaps, the @ rule is up the top of the page. Any ideas as to what I am doing wrong?

    The beginning of the sheet -

    @charset"utf-8";
    /* CSS Document */
    /*STRUCTURE*/
    *{
    margin:0;
    padding:0;
    }
    body {

    Any help would be apprecited.

    Thanks,
    Vicki

  2. #2
    SitePoint Evangelist hexburner's Avatar
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try using:
    Code CSS:
    @charset "utf-8";
    /* CSS Document */
    /* Structure */
    * {
        margin: 0;
        padding: 0;
    }
     
    body {
     
    }
    FOR SALE: 1 set of morals, never used, will sell cheap

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Location
    Melbourne, Australia
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tried it and still getting the error!! Any more ideas????

    Vicki

  4. #4
    SitePoint Guru
    Join Date
    Nov 2005
    Location
    Norway
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try saving the document as UTF-8 without BOM.
    See the HTML FAQ for more info about BOM

  5. #5
    SitePoint Zealot Rexibit's Avatar
    Join Date
    Jul 2008
    Location
    United States
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If all else fails, just removed "@charset"utf-8";" at the beginning and let it validate the rest of your entries. Then, apply it back in pieces to see where the error is.
    Rexibit Web Services
    Don't just build it - CSS it

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Location
    Melbourne, Australia
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, but can't see what is going wrong. I deleted "@charset uft-8" and the page validated, but as soon as I started applying it back it came up with error. Can I use the sheet without it?

    Vicki

  7. #7
    SitePoint Zealot Rexibit's Avatar
    Join Date
    Jul 2008
    Location
    United States
    Posts
    178
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, you can use the CSS sheet without it. I don't use it in my sheets. I let the HTML meta tags determine the character set.
    Rexibit Web Services
    Don't just build it - CSS it


Bookmarks

Posting Permissions

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