What to learn html 4.01 or html 5

What benefits?

Thanks, that was very helpfull.

If you are going to serve it as HTML them it doesn’t matter which of those two doctypes you use as it will still be HTML 4 that you are using. Only if you serve XHTML 1.0 as XHTML is it different - and then there are lots more differences than just a few extra /.

Just one example: XHTML will let you know if you have made an error in the XHTML by not displaying the page. That way you can make sure the error if fixed before you upload the page to the web. You always know that your XHTML on the web is valid and so don’t need to hope that all browsers will handle anything that is invalid the same way.

Most people would see that ‘feature’ of XHTML as a drawback.

I was really surprised you said that many people would start to see the benefits of XHTML when IE 8< is dead. I thought serving pages as XHTML died a long time ago.

Yes, those who don’t really care whether their page will display correctly in ALL browsers would see proper validation as a drawback. Those professionals who want to reduce the time they spend on validating pages will see it as a huge benefit - if the page displays it is valid, only if it doen’t display do you then have to spend the extra time to run it through the validator to find the error(s).

Since it hasn’t really been born yet it can’t have died a long time ago.

Once IE8 is dead both XHTML 1.0 and XHTML5 will become possible and then people might start using them.

If XHTML died a long time ago then why is a new version currently being created alongside the new HTML version? If it were dead then a new version wouldn’t be under development.

Now XHTML 2.0 did die a while back as it was too radically different from anything that had come before and it looked very much like no browser was even considering the possibility of implementing support for it.

XHTML 1.0 is as well supported by the latest versions of all browsers as HTML 4 is. It is only old versions of IE that don’t support it. It is just a pity that the latest version of IE doesn’t run on Windows XP as that will slow down people being able to upgrade to the latest version which has just implemented XHTML support (why would Microsoft have just implemented something that is long dead - because it isn’t long dead).

XHTML 5 should be as well supported as HTML 5 is since they are being developed in parallel and browsers have no reason why they’d implement one variant and not the other.

XHTML certainly isn’t long dead. Today is the first day where the latest versions of ALL browsers finally support it. XHTML has finally today begun its birth process and just needs to wait for IE8 and earlier to die out so as to finish being born.

[ot]If you use XHTML5 it MUST be served as an application of XML so XHTML5 is NOT backwards compatible unlike ‘XHTML 1.0 Transitional’ (it’s XHTML 2.0 that got discontinued) NOT XHTML.

Probably now calling itself just HTML. How the future browser will trigger the XML processor might be interesting though.[/ot]

Does that mean that XHTML 5 can be served either as XML or as XHTML but not as HTML (given that XHTML is an application of XML)?

Since IE9 claims to support the current version of the proposed standard has anyone had time to test it yet to see how it handles XHTML 5?

To bring it back on topic - now that all the latest browsers do support XHTML it should have some impact on the usefulness of learning XHTML as an addition to learning HTML. There is no longer any doubt that it will be possible to use it for web pages at some point in the future.

You just add trailing slashes :wink:

I am also a beginner and I am trying to learn more first about html 4.01. My friend told me that I need to learn it first the platform of html 4.01.

My opinion is that the OP should learn HTML 4.01 Strict first. There is no need to learn HTML5 or XHTML, at least, not until after the OP has become competent in writing HTML 4.01 using a Strict doctype.

I don’t use HTML5, because I’ve not yet needed to use its new features, such as canvas and other features. Until then, I’m sticking with HTML4. I can’t see why a beginner would need to learn HTML5 right away.

XHTML is an application of XML. Therefore there is little need for a beginner to use it, unless he has a good reason for doing so.

So, these are my basic reasons for why I recommend the OP forgets about HTML5 and XHTML until he has become competent in HTML 4.01. I believe others have already covered other reasons why HTML 4.01 is best to start with.

No - that is HTML with surplus slashes - it is NOT XHTML.

If the MIME type is text/html then it is HTML regardless of whether the trailing slashes are there or not and regardless of what doctype you use.

I use the XHTML doctype on all the pages of my web site even though all but one of the pages are just HTML. That is simply because I prefer using the XHTML validator to validate my HTML 4.01 rahter than using the HTML one. The only page that I have that uses XHTML is Real XHTML which is a web page I set up to demonstrate exactly how XHTML differs from HTML.

Try accessing that web page in an old version of IE and you will see why web pages are not yet able to be created using XHTML, try it in IE9 or some other web browser and you will see how once IE8 and earlier die out that XHTML will then be usable for web pages.

Just because a web page uses an XHTML doctype and extra slashes doesn’t mean you are not using HTML 4.01 for your page. The XHTML doctype and the extra slashes are allowed to be used with HTML 4.01 provided you restrict yourself to the subset of XHTML 1.0 that works as HTML.

If we paint you green does that mean that you are grass and not a person? No, and neither does using an XHTML doctype and extra slashes make your page XHTML if you are still using the text/html MIME type.

If the MIME type is text/html then the browser will treat whatever you put in your web pages as being whatever version of HTML that the browser is designed to understand and will ignore anything that doesn’t match that version. So if you run your web page in IE7 then the version of HTML that is used is IE7-HTML regardless of the doctype.

The point about the HTML 4.01 standard is that it represents the subset that all the different browser HTMLs (post Netscape 4) have in common. No browser makes any use of the doctype in processing the HTML whatsoever (some do use it as a switch to determine how to interpret some CSS but the actual version information is completely ignored).

Hmm.

XHTML5 is the XML serialization of HTML5. When I last looked at the Draft that was the case: ‘application/xhtml+xml’ or ‘text/xml’ ‘application/xml’ were the only options for XHTML5, which makes total sense. XHTML5 requires XML’s strict, well-formed syntax anyway.

I’d be interested to see how IE9 handles XHTML well-formedness errors if somebody wants to try? As I don’t have the facilities to install it myself.

It does nothing. I copied Stephen’s example and removed the closing </p> tag. Firefox complains, as it should, IE9 displays the page anyway.

http://www.cemerson.co.uk/xhtml.php

I thought their we’re no HTML cross-platform issues? ZING!

Glad you Cherry Picked my comments. :wink: Now, if you would have read all of my comments you would have found out the difference between the two. On one hand, you have a non-profit, recommendation committy . On the other hand, you have for-profit, browser making Corporations. See the difference? ZING!

there *
were *

Anyway, who said that?

Thanks Teacher. :slight_smile: You did. Selective memory?

I have never claimed there were no HTML cross-platform issues

Anyhow, you do admit HTML is not compatible across all platforms? Thanks, you just solidified my point for annihilation of the W3C. Time for the Corps to have their own committee, and not the W3C, because the standards are crap.

Yes, there are cross browser issues with HTML. No, your proposed ‘solution’ is still terrible, and unworkable.