Do I need to include DOCTYPE info at the top?

I took these two lines out of my code and then my webpage suddenly rendered some tables differently. Do I really need to include these two lines? Is there a website out there that will take my existing html tags and convert them to the newer html 5.0 standard?

Thanks you!

<!DOCTYPE html PUBLIC ‘-//W3C//DTD XHTML 1.0 Strict//EN’ ‘http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd’>

<html xmlns=‘http://www.w3.org/1999/xhtml’ lang=‘en’ xml:lang=‘en’>

Yes you do!

Can you help me with the other question I had?

html 5 is not a standard as yet and it will probably take some years before it is anyway. Why don’t you tell us you problems?

That standard is still being developed and will probably change a lot by the time it eventually becomes a standard.

Of course everything that is valid in HTML 4 is also going to be valid in HTML 5 so as long as your page actually does validate as strict there is nothing that needs to be converted in order for it to be HTML 5. Only the 95%+ of sites still using HTML 3.2 tags in their pages will have tags that need converting for HTML 5 and they already need converting to comply with the 1997 HTML 4 standard (and the transitional doctype is there to use during that conversion process while there are still HTML 3.2 tags in the page that are yet to be replaced).

It’s somewhat telling that the doctypes in this 2002 ALA article are still the standard…

Use the HTML 4.01 Strict doctype. XHTML is going out the door and HTML 5 isn’t ready for prime time yet. If your site is already coded in XHTML, it’s your call whether it’s worth recoding it to make it compliant.

If that is true then why is Microsoft introducing support for it in IE9?

It is only XHTML 2.0 that has been dumped - XHTML 1.0 and 1.1 are alive and well and will only become more useful once IE finally supports it properly.

All true, Stephen. I should have said that XHTML is no longer in development. MS, as usual, is well behind the curve, but XHTML will be supported by mainstream browsers (finally including IE, as you note) for the foreseeable future. However, unless I’m entirely misreading the tea leaves (and the ten zillion design blogs I scan), XHTML will never be upgraded. To me, that relegates it to the scrap heap of history, no matter how viable it may be for now.

XHTML 5 is at the same draft stage as HTML 5 is at so the upgrade is already well underway.

To get back to the “convert to html5” part of the question, the answer is WHY?

If your doctype declares the code as html4.01 strict and you haven’t made any mistakes, it will be interpreted correctly. If you declare it as xhtml 1.0 strict or html 4.0 transitional or any other standard and you are using the correct tags for that doctype, then the code is correct. <body> is a legal tag in all the above for example, as is <p>, <h1>, <ul> etc etc etc. so there is NO conversion required - if the tag is part of the declared doctype, the tag is correct. There is nothing to stop you using html 4.01 strict fot the next ten years, even if html5 suddenly had a standard published today.

XHTML is no longer under development, although there’s nothing stopping you from using it today

XHTML5 is HTML5 with XHTML syntax, nothing more and nothing less

You don’t need to “convert” any website into HTML5 - it’s all the same thing at the end of the day. HTML5 is just another iteration of the HTML spec, with a new non-versioned doctype (and doctypes are required)

There’s nothing new about the HTML5 doctype as that is a perfectly valid SGML doctype for use with any SGML based version of HTML (that includes HTML 2, HTML 4.01 and everything in between). The only difference with HTML 5 is that the doctype tag in HTML 5 is now part of HTML rather than being an SGML identifier.

yep, the future of xhtml

atm I code in xhtml1.0 Strict but if/when html5 becomes a fully fledged “standard” (but in reality only a recommendation) I will switch to coding in html5.

and my :twocents: says doctypes are “required” but not technically “needed” but if you don’t declare a doctype then if your web page doesn’t already break in some browsers, it most certainly will in the future.

Oh yeah, you’re completely right. I just struggle to find a good term for it since “The HTML5 doctype” is also a lie :slight_smile:

Just because they’ve stopped working on XHTML2 doesn’t mean you can’t use XHTML1.0 and can’t use HTML5 today (the latter two will work, and will always work, in most modern browsers)

Although sure, they’re not needed but it saves a lot of grief :slight_smile: