Results 1 to 2 of 2

Thread: validate CSS 3 with HTML 4.01 strict

  1. #1
    Join Date
    Mar 2009
    Location
    Atlanta
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default validate CSS 3 with HTML 4.01 strict

    Never can tell??

    A couple of days ago I built a new webpage and as usual tried to validate my HTML 4 strict and CSS 3 . The HTML4 validated just great with CSS2.1, but threw a tantrum when I posted the CSS3 validation code and reran HTML4 Strict.

    This is the offending line:

    &profile=css3&usermedium=all&warning=1

    which is OK on the CSS validation page, but will not pass inspection if ran AFTER posting the WHOLE link to my web page. Everything is the same except for that last line.

    Run as CSS2.1 (with " & ") and all is well.

    Run as CSS3 and the validator gives 6 errors on this part of the code alone. It seems to hate the " & " and the " = " and even the " W " in warning?? !!

    Would like to validate HTML 4.01 Strict with CSS3.

    Any help??

    -------------------------------------------------------------------
    SEEMS I FOUND MY OWN ANSWER
    -------------------------------------------------------------------
    FROM:

    http://www.htmlhelp.com/tools/valida...blems.html#amp

    Another common error occurs when including a URL which contains an ampersand ("&"):

    <!-- This is invalid! --> <a href="foo.cgi?chapter=1&section=2&copy=3&lang=en">...</a>

    This example generates an error for "unknown entity section" because the "&" is assumed to begin an entity reference. Browsers often recover safely from this kind of error, but real problems do occur in some cases. In this example, many browsers correctly convert &copy=3 to ©=3, which may cause the link to fail. Since &lang; is the HTML entity for the left-pointing angle bracket, some browsers also convert &lang=en to 〈=en. And one old browser even finds the entity &sect;, converting &section=2 to §ion=2.

    To avoid problems with both validators and browsers, always use &amp; in place of & when writing URLs in HTML:

    <a href="foo.cgi?chapter=1&amp;section=2&amp;copy=3&amp;lang=en">...</a>

    I just wanted to tell a bunch of people so they would not waste 2-3 DAYs trying to figure out their coding for HTML4 transitional, HTML 4 STRICT, CSS 2.1 and CSS3 !!

    !It is way too much like easy for W3C to add this to the validation process !

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Yeah. Using the & alone anywhere will bring an error it should always be coded similarly with < > and a number of other symbols. The entities can be found from googling though easily enough. Or you could look here http://www.w3schools.com/tags/ref_entities.asp

Tags for this Thread

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
  •