Forum Moderators: open
As long as they contain "many errors" as you say, they aren't... ;)
Seriously, that's up to you to decide. Select the HTML version that serves your purposes best, and then code your pages according to the respective standard. If you're transitioning old code, then one of the "transitional" versions will make things easier, because those support constructs that are deprecated in the "strict" versions.
I think the most popular versions are HTML 4.0.1 [w3.org] for the more traditionally inclined, and XHTML 1.0 [w3.org] for the progressive minds.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
If it seriously mucks up your page, then chop off the URL, and use this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
This is the DOCTYPE for HTML 4.01 Transitional, which is the most forgiving specification. I wouldn't bother with XHTML until you become much more familiar with validation and web standards, if at all, but you may want to move to HTML 4.01 Strict later on.
The full list of valid DOCTYPEs is here:
[w3.org...]
Hope this helps!
Wet? The tramways stopped operating here, because they got stuck in the snow...
Should I just put a DOCTYPE as HTML4.0.1 and try to validate it via W3C, and if there are too many errors then try to validate it as XHTML 1.0?
Validating to HTML 4.0.1 is what I'd recommend as a start. XHTML is very similar to that, just that it's less forgiving about syntax. If you want to switch to XHTML later, then you'll have to write all your tags and attribute names in lowercase, close all tags, and adhere to other similar formalities.
If it seriously mucks up your page, then chop off the URL [off the doctype],
This is equivalent to having no doctype at all, which means that the browser goes into "quirks" mode. It will usually emulate as many old browser bugs as possible, in order to render broken HTML "as intended". If you want your pages to be valid HTML, don't do this.
Please take this one seriously - I think that many people (especially the forum begginers) don't really know the answers to those questions...
Since XHTML is less forgiving why bother using it?
Contrary to the beliefs of your local church, forgiveness is not always a virtue. The more forgiving a browser, the more it is having to 'guess' what you meant and therefore the more room for errors.
Can You make exactly the same layout in loose & strict HTML?
Yes. Loose HTML lets you use deprecated tags, which is handy for those who are converting an existing page. For new pages I would aim to use strict html, particularly where backwards compatability with ancient browsers is not required.
What's the use of validation since most browsers don't seem to crash on the layout even if it has more than 200 validation errors?
Okay, your page looks okay in Internet Explorer, so why bother validating? Well:
Because some time in the (possibly far away) future, browsers will stop supporting the older HTML versions. This doesn't mean that you need to change all your existing pages right now, but there's no point in writing new pages in HTML 4.0.1, when you can use the future proof XHTML 1.0 with the same effort.
What's the use of validation since most browsers don't seem to crash on the layout even if it has more than 200 validation errors?
In the worst case, the page may be completely invisible in standards conforming browsers (most commonly because of missing </table> tags), or its contents may get ignored by search engine spiders.
When working with (or writing) software, there's an old principle that will give you the best results in widely varying situations and environments: Be relatively generous in the data you accept, but very strict in the data you create. Just because Microsoft writes sloppy code doesn't mean you have to do the same.
Can Doctype be replaced with this code:
<meta http-equiv="content-type" content="text/html;charset=ISO-8859-1">?
You require both in for your document to be valid [validator.w3.org].
Doctype specifies which version of (X)HTML you are using, whereas Content-Type specifies the character set you have used.
there's no point in writing new pages in HTML 4.0.1, when you can use the future proof XHTML 1.0 with the same effort.
I'll stick with HTML4.01 strict thanks.
I don't see the point in going to XHTML until more clients can handle the "application/xhtml+xml" MIME type properly and if you are simply serving the XHTML as text/html then what is the point?
See..
The main point is that you won't have to change it again in the future.
Remeber that valid XHTML 1.0 is also valid HTML 4.0.1, but not necessarily the other way round. So you can just declare it as HTML 4.0.1 now, but write it so that it satisfies the stricter XHTML requirements. And once you think that your visitors are ready for XML, just switch the doctype, and you're done!
The forgiving doctypes are the transitional ones. If you write transitional XHTML, you've still got some big bumps in the road ahead.
It's only XHTML 1.1 that should not be served as text/html.
If, as the circulars warn, xhtml that is being served as text/html, for the sake of renderablility in older browsers, is NOT xhtml, would it make more sense to stick with html 4.01 strict?
Folks don't seem too optimistic about browser technology catching up with xml in the very near future--some are suggesting it will 2007 before true application/xhtml+xml, will be able to replace text/html. Where do we, the greenhorns put our stick in the mud?
Here I was trying so hard to make the change to xhtml 1.0 Strict, and then I run across these articles saying to stick with html 4.01. Can anyone clear up the confusion?
But does it have any real to anyone now a-days?
Ok so its there to ensure you page complies with HTML Broswers so you get the best results on those browsers.
I just wonder if every one of 5,000+ page for one of my sites, needs to have a doctype header. Is it a big mistake not to have it, will your site be hindered without out.
What are the reals reasons now that we are in 2004?
Because some time in the (possibly far away) future, browsers will stop supporting the older HTML versions.
I doubt any browser will drop html support in the medium term due to the billions of dodgy html pages out there. In your predicted future, who will re-write all these pages? If these pages aren't re-written, why would users upgrade to a newer browser that decreases the number of websites they can view?
This doesn't mean that you need to change all your existing pages right now, but there's no point in writing new pages in HTML 4.0.1, when you can use the future proof XHTML 1.0 with the same effort.
Why rely on browsers' non-standard error handling routines to render your xhtml page now, when converting (good) html to xhtml is trivially simple to do should the requirement ever arise? Since it is so easy to transform html to xhtml, html is no less future proof than xhtml.
This future proofing stuff is FUD. xhtml is currently a (badly supported) solution in search of a problem.