How can you find the html version from source code.
How can you find the html version from source code.
(OP)
I have tried to figure out which version of html I am dealing with, but there are inconsistencies.
Q1: I have looked at !DOCTYPE html which I believe tells me it is HTML1.0. But should all!DOCTYPE show which version it has?
My main goal is to identify the version and if a version HTML1.0 is found I must convert it to HTML2.0.
Q2: Can dreamweaver 2014 1.1 convert HTML1.0 TO 2.0? If not, what would be the best approach?
Thanks.
Q1: I have looked at !DOCTYPE html which I believe tells me it is HTML1.0. But should all!DOCTYPE show which version it has?
My main goal is to identify the version and if a version HTML1.0 is found I must convert it to HTML2.0.
Q2: Can dreamweaver 2014 1.1 convert HTML1.0 TO 2.0? If not, what would be the best approach?
Thanks.
RE: How can you find the html version from source code.
RE: How can you find the html version from source code.
Source
1.<!doctype html>↩
2.↩
3.<!--[if lt IE 9]>↩
4.<html class="no-js lt-ie9" dir="ltr" lang="en" xmlns="http://www.w3.org/1999/xhtml">↩
5.<![endif]-->↩
6.<!--[if gt IE 8]><!-->↩
7.<html class="no-js" dir="ltr" lang="en" xmlns="http://www.w3.org/1999/xhtml">↩
8.<!--<![endif]-->↩
9. <head>↩
10. ↩
11.<meta http-equiv="X-UA-Compatible" content="IE=edge">↩
12.<meta charset="utf-8">↩
...Still looking for the type of HTML or XHTML?
RE: How can you find the html version from source code.
That means, if you start with...
CODE
...but include some markup that only appears in HTML5, you should not expect this to be a true HTML2 document.
Why are you wanting to convert from a 20+ year old specification to another 20+ year old specification?
The line you have shared...
CODE
...suggests you are not actually dealing with HTML1 or HTML2 because this markup didn't exist 20 years ago.
RE: How can you find the html version from source code.
I believe what they want me to do is to convert XHTML2.0 or older to XHTML4.0 not higher. I have noticed that in some source code from recent pages the word HTML4 is used, does it mean XHTML4, what is the difference?
Thanks again.
Sincerely.
RE: How can you find the html version from source code.
https://en.wikipedia.org/wiki/XHTML
I'm still unclear about the requirement to update/convert to another standard. That is not usually needed for archived/legacy content. The idea is that if your doctype refers to something from 1998 and properly restricts its markup to that doctype, a modern browser will still know how to render that properly. The problem happens when you change the doctype but leave the original markup (or the opposite).
To that end, it may be best to just use a validator and set it to your target intent (HTML4, unaware of XHTML4). Then review/correct the bad markup that it flags.
RE: How can you find the html version from source code.
Sincerely,
Stephane