W3C home > Mailing lists > Public > www-validator@w3.org > October 2003

RE: Style tag not validated correctly for HTML 4.01

From: Ville Skyttä <ville.skytta@iki.fi>
Date: Wed, 29 Oct 2003 19:46:06 +0200
To: Gavin Lambert <gavinl@compacsort.com>
Cc: www-validator@w3.org
Message-Id: <1067449565.1285.86.camel@bobcat.mine.nu>

On Wed, 2003-10-29 at 07:40, Gavin Lambert wrote:

> Side note, I thought XML syntax is fine for HTML 4,

Depends on the definition of "fine" :)  Anyway, it may validate but will
most likely not be what you mean.  Experiment with the validator's "show
parse tree" option.  Hint: for "<br />" in HTML, the br element ends at
the "/".

> so long as you include a space, as "<br />".

The space has nothing to do with validity.  In *XHTML* (not HTML, see
above), using it may produce "better" results when viewed with a user
agent that groks HTML but not XHTML: http://www.w3.org/TR/xhtml1/#C_2

>    1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>    2: <html>
>    3: <head>
>    4:   <title>Pueblo/UE News</title>
>    5: <meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1">
>    6:   <basefont face="Verdana,Arial,Helvetica" size=2>
>    7:   <style type="text/css">

The culprit is the basefont element which is not allowed in HEAD and
thus implicitly closes it and begins the BODY.  See the parse tree at
Received on Wednesday, 29 October 2003 12:52:02 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 November 2015 11:01:20 UTC