Since the past few years, HTML5 has become popular, and HTML5 development engineers have become very popular in the talent market. As an HTML5 developer, interviews are essential. This article summarizes and introduces ten classic front-end HTML5 interview questions that you may not be familiar with. I hope it will be of some help to you in your interview. I won’t say more below. Enough said, let’s take a look at the detailed introduction.
1. What is HTML5?Answer: HTML5 is the latest HTML standard.
Note: Describe the design purpose of HTML5 launch, as well as current market usage, browser support, etc. . . .design purpose
HTML5 is designed to support multimedia on mobile devices. New syntax features were introduced to support this, such as video, audio, and canvas tags. HTML5 also introduces new features that can truly change the way users interact with documents, including:
· New parsing rules increase flexibility
· New properties
· Eliminate obsolete or redundant attributes
· Drag and drop functionality from one HTML5 document to another
2.What are the different new form element types in HTML5?Answer: The local verification form needs to be wrapped with a form tag to see the effect.
Answer: A typical WEB page includes a header, footer, navigation, center area, and sidebar. Now if we want to render this content in an HTML area in HTML4, we may want to use DIV tags.
But in HTML5, by creating element names for these areas, we make them clearer and make your HTML more readable.
Here are more details of the HTML5 elements that form the structure of the page: (note that the main consideration is tag semantics)
Answer: Almost all high-end browsers such as Safari, Chrome, Firefox, Opera, IE8 and above support HTML5
5. Why do we not need DTD (Document Type Definition) in HTML5?Answer: HTML5 does not use SGML or XHTML. It is a brand new thing, so you do not need to refer to the DTD. For HTML5, you only need to place the following document type code to tell the browser to recognize that this is an HTML5 document.
6.HTML5 offline storage?Answer: localStorage stores data for a long time, and the data is not lost after the browser is closed;
sessionStorage data is automatically deleted after the browser is closed.
7. How does the browser manage and load HTML5 offline storage resources?answer:
(1) When online, the browser finds that the HTML header has the manifest attribute, and it will request the manifest file. If it is the first time to access the app, the browser will download the corresponding resources based on the contents of the manifest file and store them offline. . If the app has been accessed and the resources have been stored offline, the browser will use the offline resources to load the page, and then the browser will compare the new manifest file with the old manifest file. If the file has not changed, no operation will be performed. , if the file changes, the resources in the file will be re-downloaded and stored offline.
(2) When offline, the browser directly uses the resources stored offline.
8. Please describe the difference between cookies, sessionStorage and localStorage?(1) Cookies are passed back and forth between the browser and the server, sessionStorage and localStorage do not.
(2) sessionStorage and localStorage have larger storage space.
(3) sessionStorage and localStorage have more rich and easy-to-use interfaces.
(4) sessionStorage and localStorage have independent storage spaces.
9. What are the uses of the Page Visibility API?Answer: When the page is switched to other background processes, the playback of music or videos will be automatically paused.
10.How to turn off the auto-complete function in HTML5 form?Answer: Just set autocomplete=off for input that you don’t want prompts for.
SummarizeThe above is the entire content of this article. I hope that the content of this article has certain reference value for everyone's study or work. If you have any questions, you can leave a message to communicate. Thank you for your support to VeVb Wulin Network.