How to distinguish between HTML and HTML5?

How to distinguish between HTML and HTML5?

I often ask in interviews-how to distinguish between HTML and HTML5?

The core is: the way of DOCTYPE declaration is an important factor to distinguish HTML and HTML5 marks.

(The one that looks like this is HTML:

html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

The one that looks like this is HTML5: <!DOCTYPE html>

 

In addition, it can also be distinguished according to the newly added structure and function elements:

The new features of html5 include painting canvas, video and audio elements for media playback, local offline storage localStorage, long-term storage of data, sessionStorage, in addition, the following major types of elements have been added:

Content elements, article, footer, header, nav, section.

    Form controls, calendar, date, time, email, url, search.

    Control elements, webworker, websockt, Geolocation.

Guess you like

Origin blog.csdn.net/zhongheng310/article/details/114052461