Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

W3C Validator Error - HTML 4.01 Strict 1

Status
Not open for further replies.

seaport

MIS
Jan 5, 2000
923
US
My code is simple enough.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd">[/URL]
<html>
<head>
<title>Main Menu</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body>
<form name=frm id=frm method="post" action="fafsaf.asp">
    <input type=text value="fafdsasf">
    <input type="SUBMIT" value="Submit">
</form>
</body>
</html>
But I still got the error - document type does not allow element "INPUT" here... - at W3C Markup Validator
What did I do wrong?

Thanks in advance.

Seaport
 
You have to put your inputs inside of a block level element tag, like a div.





[monkey][snake] <.
 
Hi, Monksnake,

Thanks a lot for the QUICK response. It works.

I am new to this "HTML 4.01 Strict," but I want to do it right. Could you give me some links about HTML 4.01 Strict, like why I have to put inputs inside a DIV?

Seaport
 
I'll look up some W3C documentation, but off the top of my head one of the rules to be Strict is to make sure any inline element is contained within a block element. The idea is that no inline element is just "floating" around no within any container.



[monkey][snake] <.
 
Well, I couldn't find it directly from the horse's mouth (w3c), but I found this


HTML Containment Rule Issues
Inline Elements in <body>
When using the HTML 4.01 Strict DTD (nesting rules), there can only be block-level elements directly inside <body>—unlike when using the Transitional DTD (nesting rules).

Block-Level Elements in <p>
The <p> element can’t contain any block-level elements including <p> itself. The block-level elements are <p>, headings, lists, <div>, <noscript>, <blockquote>, <form>, <hr>, <pre>, <table>, <fieldset> and <address>.


[monkey][snake] <.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top