Results 1 to 9 of 9

Thread: Need help - CSS parse error

  1. #1
    Join Date
    Nov 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need help - CSS parse error

    During my CSS validation in WC3 I got a very strange parse error in the body:

    Parse Error -
    body {
    background: url(../images/body-bg.jpg) repeat-x top left;
    padding-top: 40;
    margin: 0 auto;
    line-height: 1.5em;
    }

    This is the only error I received, however Dreamweaver didn't detect this error at all - everything renders perfect in all browsers, can anyone help?
    Last edited by iF15; 11-16-2007 at 07:38 AM.

  2. #2
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Code:
    body {
    background: url(../images/body-bg.jpg) repeat-x top left;
    padding-top: 40px;
    margin: 0 auto;
    line-height: 1.5em;
    }
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    padding-top: 40;
    You forgot to specify units. The only measurement that doesn't require units is 0, which is the same on any scale.
    everything renders perfect in all browsers
    If it renders perfectly on most browsers this means that your document is outdated or invalid in some way, thus triggering quirks mode in those browsers. Your DOCTYPE should be:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Maybe it just means that the page looks OK with no added padding on the body element.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Could be, could be. In this case you should remove the declaration entirely, or explicitly set it to 0.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Nov 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Sorry guys that was a typo I didn't put "px" on the first post I made. Strange how theres a error aye?

    My doc type is:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    Last edited by iF15; 11-16-2007 at 12:16 PM.

  7. #7
    Join Date
    Nov 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I had to add "@charset "utf-8";" at the top of my CSS file which got rid of the error. Is that normal?

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    If you had a UTF-8 character (possibly whitespace) that can't be interpreted as whatever your webserver was serving it as (probably ISO-8859-1), then yes.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey View Post
    If you had a UTF-8 character (possibly whitespace) that can't be interpreted as whatever your webserver was serving it as (probably ISO-8859-1), then yes.
    Good! Probably, even. We can't be 100% sure without seeing the live page though.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •