W3C home > Mailing lists > Public > www-validator-css@w3.org > May 2010

The discrepancies in the validation code for HTML and CSS

From: Kenneth Kin Lum <kenneth.kin.lum@gmail.com>
Date: Sun, 30 May 2010 05:17:00 -0700
Message-ID: <AANLkTimkM0kxl9zwGrMIvpGntqkTxbVqvm1KTMz96bPU@mail.gmail.com>
To: www-validator-css@w3.org, www-validator@w3.org, www-style@w3.org
The validators of HTML and CSS are fantastic.  I'd like to suggest the code
of the HTML and CSS validation image and link be more consistent across the
two platforms.

The HTML suggestion on http://validator.w3.org is:

<p>
    <a href="http://validator.w3.org/check?uri=referer"><img
        src="http://www.w3.org/Icons/valid-html401"
        alt="Valid HTML 4.01 Strict" height="31" width="88"></a>
  </p>


while the CSS suggestion on http://jigsaw.w3.org/css-validator is


<p>
    <a href="http://jigsaw.w3.org/css-validator/check/referer">
        <img style="border:0;width:88px;height:31px"
            src="http://jigsaw.w3.org/css-validator/images/vcss"
            alt="Valid CSS!" />
    </a>
</p>


It looks like the HTML validation link is a little bit paranoid as to being
afraid that extra space might be added in front of the <img> tag, that's why
the <img> begin tag is right after the <a> tag.  But

1) Most likely, it won't be a white-space: pre  (or <pre>) when showing this
link.
2) Even if it is, the spaces in front of the <a> tag will make a difference
too, so the user will edit the code to remove those space in that case.
3) If the HTML part is afraid of that, how come the CSS part is not afraid
of the extra space?
4) When it is not white-space: pre or <pre>, then any white space before and
after displayable content is ignored.  Only space between displayable
elements is actually taken into effect when shown on the display or media.

Because I think w3.org is very good at setting standard that everybody uses,
so we can unify the code as in

<a href="http://validator.w3.org/check?uri=referer"> <img src="
http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Strict"
height="31" width="88"> </a> <a href="
http://jigsaw.w3.org/css-validator/check/referer"> <img
style="border:0;width:88px;height:31px" src="
http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"> </a>


When the CSS validator detects that it is HTML 4.01 instead of XHTML 1.0, it
can also make the <img> tag use HTML instead of XHTML.

a sample is put on

http://www.ijwtlyk.com/proj/html/html401andJavascript.html
Received on Sunday, 30 May 2010 12:17:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 27 June 2012 00:14:26 GMT