So the w3c validator says I've got an html 4.01 frameset document, with "No Character encoding declared at document level"; tidy says:
Code:
03:11:29 /home/barrie/www $ >> tidy ./index1.html | head --lines 10
Info: Doctype given is "-//W3C//DTD HTML 4.01 Transitional//EN"
Info: Document content looks like XHTML 1.0 Transitional
No warnings or errors were found.
and heres the first bit of the file:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/HTML4/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<HEAD>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<TITLE>Test Page</TITLE>
<link rel="stylesheet" type="text/css" href="./index1.css" />
</HEAD>
.
.
.
Which validator is correct and how do I fix the character encoding in the doc.??? I've tried pasting just about every available option!
Remove ALL " /" (space and "/") from those tags that normall do not need closing tags in HTML 4.01.
Go with the validator first. HTML Tidy has lots of options that can be set and somewhat dependent on whether you are using someone's add-on or not. Maybe look into using the W3C's or try these:
Make all your tags and attributes in lowercase to keep from developing a bad coding habit should you go to XHTML.
Two other good habits to adopt, but they are by no means necessary, always quote your attribute values even when unnecessary and always use the optional start and end tags. Not so much to get yourself ready for XHTML but so that you don't have to remember the rules governing when you can omit quotes and tags.
That said, one thing that does trip people up is the use of the THEAD and TBODY elements. In HTML they are required but their tags are not. If you omit the tags then the browser inserts a TBODY element anyway. You only notice it, though, when you are tinkering with the document using JavaScript and sometimes in your CSS. XHTML doesn't have optional tags so if you omit the tags you have omitted the element and you end up with a different document when the document is parsed as HTML instead of XHTML.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
Thank you everyone for your posts. I've switched to XHTML 1.0 Strict and am now 'editing for compliance'. It's been years since I've done any page development and it's changed a bit. Is xhtml a good choice right now in regards to page longevity?
Is xhtml a good choice right now in regards to page longevity?
No, XHTML is for something other than web pages. You can use it for that but you really have to know HTML and you really have to know XML to use it that way. And you must read, mark, learn and inwardly digest Appendix C to the XHTML 1.0 specification.
For web pages, use HTML 4.01 strict. That'll give you the most supported version and should work for the next hundred years or so.
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
No, XHTML is for something other than web pages. You can use it for that but you really have to know HTML and you really have to know XML to use it that way. And you must read, mark, learn and inwardly digest Appendix C to the XHTML 1.0 specification.
For web pages, use HTML 4.01 strict. That'll give you the most supported version and should work for the next hundred years or so.
Bookmarks