HTML 4.01 STRICT Invalid markup error

I tried to check my page and had some problems with the form section. So I created a test page to see what was happening, and still failed, so I think I can do something wrong.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <title>Test</title> <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> </head> <body> <form action='test.html'> <input type='submit'> </form> </body> </html> 

This is my test page. When I copy it to http://validator.w3.org/check , it gives me two errors:

 Error Line 10, Column 24: document type does not allow element "INPUT" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "ADDRESS" start-tag <input type='submit'> 

and

 Error Line 11, Column 9: end tag for "FORM" which is not finished </form> 

Even without the submit button, she still gives me a second error. I am stuck for the reason why this is happening. Any ideas?

+4
source share
1 answer

To check, you need to have some kind of container tag inside the form tag. Some use Fieldset, but I always wrap everything in a div, which is in my form.

+4
source

Source: https://habr.com/ru/post/1397356/


All Articles