Click to See Complete Forum and Search --> : Weird. Check this out.


Zach Elfers
02-22-2003, 03:57 PM
I have attached an file. Change this files extension to *.html and validate at www.w3.org

It validates correctly! What is wrong with this?


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-type" content="text/html;
charset=iso-8859-1">
<title/Unbelievable/
<TABLE width="100%">
<tr>
<td width="20%"><h1/This/
Is<br>
All<br>
Legal!
</td>
<td width="80%">Does this look like valid HTML to you?
<p>Well, it is.
<a href="http://validator.w3.org/check?
uri=http://my.ip.too.bad/w3c.html">
Click to validate at the W3C.</a>
</td>
</tr>
</TABLE>

Stefan
02-23-2003, 04:51 AM
I'm guessing it is interpreting

<title/unbelivable/
as
<title />

But you should probably ask the W3C guys if it's really supposed to be like that (ie passing validation).

Zach Elfers
02-23-2003, 11:18 PM
There aren't even any <html> tags or <head> or <body> tags. I'll contact W3C.

Stefan
02-24-2003, 07:48 AM
Originally posted by Zach Elfers
There aren't even any <html> tags or <head> or <body> tags.

That is not a problem. All those 3 tags are OPTIONAL in HTML and can thus be left out.
Only when you move to XHTML do they become required.

The only things required in a HTML document is the doctype and a title.

Zach Elfers
02-24-2003, 04:10 PM
Oh. I thought that the <html> tags were required.

Stefan
02-25-2003, 03:44 AM
Originally posted by Zach Elfers
Oh. I thought that the <html> tags were required.

Yes, it's a very common missconception.

The HTML/HEAD/BODY ENTITY is required, but the TAGS (which mark where the entity in question start and end) are optional.

This leaves it up to the webbrowser errorcorrection to figure out where they should be (and thus leaving them out requires more CPU from the visitors comp to render the page).
Most designers thus add these tags, both for their own sanity as well as the reciving computers.