W3C home > Mailing lists > Public > www-validator@w3.org > September 2002

Re: Valid HTML 4.01? need explanation!

From: Liam Quinn <liam@htmlhelp.com>
Date: Sun, 1 Sep 2002 22:24:23 -0400 (EDT)
To: Herbert Poetzl <herbert@13thfloor.at>
cc: <www-validator@w3.org>
Message-ID: <Pine.LNX.4.33L2.0209012220050.2449-100000@localhost.localdomain>

On Sun, 1 Sep 2002, Herbert Poetzl wrote:

> the following html code puzzles me, because
> I am unable to explain the behaviour of the
> validation service at w3c.
[...]
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
>
> <HTML>
>   <HEAD>
>     <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
>     <TITLE>Good HTML</TITLE>
>   </HEAD>
>   <BODY>
>     <TABLE width="100%">
>       <TR>
>         <TD>
>           <FORM method="post" action="/someurl.html">
>
>             <P> <!-- required for validation -->
>
> 	      <INPUT type="hidden" name="user" value="hans">

In HTML 4 Strict, FORM can contain only block-level elements (and SCRIPT).
So you need to put inline elements such as INPUT in a block-level element
like P.

> 	      <TABLE>
> 	        <TR>
> 		  <TD>
> 		    xxx
> 		  </TD>
> 		</TR>
> 	      </TABLE>
>
> 	    </P> <!-- not allowed for validation -->

P can only contain inline elements while TABLE is a block-level element.
Since the ending tag for P is optional in HTML, the TABLE start-tag
implies the end of the P element.

-- 
Liam Quinn
Received on Sunday, 1 September 2002 22:24:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:04 GMT