dcsimg
www.webdeveloper.com
Results 1 to 7 of 7

Thread: What causes "Lexical error" messages using The W3C CSS Validation Service?

  1. #1
    Join Date
    May 2007
    Posts
    30

    What causes "Lexical error" messages using The W3C CSS Validation Service?

    I'm trying to validate my style sheet programming using The W3C CSS Validation Service:
    http://jigsaw.w3.org/css-validator/

    It's giving the following error message

    Lexical error at line 1, column 3. Encountered: "D" (68), after : "<!"
    It's in this part of the code apparently:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    Can anybody see what's causing the error?

    Thanks.

  2. #2
    Join Date
    Nov 2003
    Location
    Jerryville, Tejas
    Posts
    11,715
    That's HTML, not CSS. Is that the problem?

  3. #3
    Join Date
    Aug 2007
    Location
    New Jersey, US
    Posts
    1,779
    http://validator.w3.org/

    that's what you want

    validate your CSS with a CSS validator

  4. #4
    Join Date
    May 2007
    Posts
    30
    ray326, dtm32236;

    Thanks for responding. I appreciate the input.

    What I'm trying to do is validate the CSS. I figured out what was causing the error message. I was copying and pasting all of the Html, instead of just the CSS, from the web page source code into the validator.

    This page says "Enter the CSS you would like validated:"
    http://jigsaw.w3.org/css-validator/#validate-by-input

    You can run the whole web page through the CSS validator. But you have got to use this page:
    http://jigsaw.w3.org/css-validator/#validate-by-uri

    I had been working all day yesterday when I made the post. I must have been a little skull numb when I asked the question at the start of this thread. Sorry for the trouble.

  5. #5
    Join Date
    Mar 2012
    Posts
    1,840
    It seems, according to katsarov, that the problem was caused by invalid characters in the source file. These are often caused by using a word processor to edit the code. Use a text editor. By the way, the reason I deleted katsarov's post was because it contained a link to a .biz site.

  6. #6
    Quote Originally Posted by KnoxVol View Post
    What I'm trying to do is validate the CSS. I figured out what was causing the error message. I was copying and pasting all of the Html, instead of just the CSS, from the web page source code into the validator.
    Which along with leveraging caching models, using HTML for what HTML is for, and targeting multiple media and devices with CSS, is why CSS has NO BLASTED BUSINESS in the HTML in the first place.

    ... which is why I say the STYLE tag should be obsoleted and removed from the specification entirely, and why the STYLE attribute should be deprecated for all but the narrowest of corner case uses (like when style actually conveys data, like width or height on a graph built with DIV).

    99% of the time, if you have STYLE, saying what things look like in your HTML, you're doing it all wrong!

    EVEN IN TESTING. I really don't get how some people make claims like "it's easier" on that...

  7. #7
    Join Date
    Jun 2014
    Location
    India
    Posts
    85
    http://validator.w3.org/
    here you will see CSS with a CSS validator.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles