Forum Moderators: open
Possible cause is an inline element containing a block level element...
<div id="right">
<form action="index.html" method="post">
<input class="go" type="image" src="images/searchcat2.gif" /><br />
<input type="text" name="submit" size="22" />
</form>
</div>
---------------------------------------------
Everything validates without the <form> there.
Thanks as always-
I put your above code in the HTML validator inside a basic page and did not get any errors.
I know that sometimes the W3C validator will say that a particular tag is creating a problem when in fact its another tag further up the page.
You might want to check your closing tags further up the page as they might be causing the problem.
/added
I didn't read that "everything else validates"...seems odd!
Input and br elements are defined as inline elements. Therefor they must not be used directly within form elements. The additional p element (any other block-level element would have worked just als well) is a block-level element and as such allowed within the form element.
Block-level elements may contain inline elements such as input and br.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
-------------------------------------------------
Input and br elements are defined as inline elements. Therefore they must not be used directly within form elements.
I thought that the <form> element was mostly block level, therefore, <input> and <br /> would be in their correct places.
Seems I have some catching up to do;)
Thanks for your help everyone.
I thought that the <form> element was mostly block level
It is indeed, only that in the strict (X)HTML variants there are additional restraints as pointed out above. Have a look at [htmlhelp.com...] and [w3.org...] for more infos.
Input and br elements are defined as inline elements. Therefore they must not be used directly within form elements.
The standard doesn't provide any comments as to why this is supposed to make any sense, but you're right, it is indeed defined that way for the strict versions. The guys from the w3c normally have very good reasons for the the restrictions they define, but this one really has me scratching my head. One more reason to stick with the transitional definitions for the moment... ;)
[edited by: bird at 3:42 pm (utc) on Aug. 24, 2002]