Versions of html

how i can identify the versions of HTML and the vantage and advantage of both versions?


Link to content: HTML5 & CSS3 for the Real World: 2nd Edition - Section 1

To identify the version of HTML a page was written in, you should inspect the page source. You can do this by right clicking on a page and choosing View Page Source.

For HTML5, look for <!DOCTYPE html> at the top of the document. For HTML4, or XHTML, look for <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> (HTML4), or <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"> (XHTML).

As for the advantages/disadvantages, HTML5 has a simpler syntax, native support for audio, video, and responsive design, as well as enhanced semantics (e.g. <article>, <section>). The only disadvantage (if you can call it that) is that it is not supported by obsolete browsers.

HTML5 is now the standard.

2 Likes