4.01 strict weirdness

N

notbob

I'm trying to be a good html coder, using html 4.01 strict and CSS and
all that, but I'm getting conflicting info and code checking on it.

For example, I use Quanta 3.5.10 in slackware and have it set for DTD
4.01 strict and use this opening DTD line:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

Fine. Problem is, I have two pages I'm working on. One was cut n'
pasted from htmldog and modded to the above dtd. When checking it
with quanta's Tidy syntax checker, no problem. I have another page I'm
beginning which has the exact same cut n' pasted line in it and I get
an error. The error free page uses <html></html>. When I use the
same element with closing tag in the other page I get:

Warning: discarding unexpected </html>

BTW, this closing tag is auto completed, so I know it's
correct. If I delete the closing html tag in the second error-prone page,
the error goes away. I read on two different 4.01 strict reference
pages that the closing tag has been "depricated" and/or is "optional",
which seems to be confirmed by the second page with no closing tag and
no errors. Why the difference? Jes flacky software?

The only other difference I can see is, the error-free page has a
<body></body> element with a buncha other code and the 2nd error-prone
page has only <head></head> elements in it, as I check as I go and am
jes getting started on it. WTF am I missing?

nb
 
D

Denis McMahon

Warning: discarding unexpected </html>

Most likely cause is that you have an extra "</html>" at the end of the
document.

There should only be one "</html>" and it should be the last piece of
text in the document.

Rgds

Denis McMahon
 
D

Denis McMahon

Most likely cause is that you have an extra "</html>" at the end of the
document.

There should only be one "</html>" and it should be the last piece of
text in the document.

Oh, or you have an </html> closing tag without any <html> opening tag.

Incidentally, the tag is optional, but *_NOT_* deprecated.

The version attribute of the html tag is deprecated, as this information
is now given in the dtd.

The html element can also contain language and text direction attributes.

eg: <html dir="ltr" lang="en-gb">

Rgds

Denis McMahon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top