Ten common questions in HTML5 interviews and ten html5 interviews

Source: Internet
Author: User
Tags website performance sessionstorage

Ten common questions in HTML5 interviews and ten html5 interviews
Ten frequently asked questions during HTML5 interviews


1. What is the new HTML5 document type and character set?
HTML5 document type is simple: <! Doctype html>

Example of HTML5 using UTF-8 encoding: <meta charset = "UTF-8">
2. What HTML4 labels does HTML5 discard?
HTML5 discards outdated and unreasonable HTML tags:
<ul><li><span style="font-family: 'Times New Roman';">frame</span></li><li><span style="font-family: 'Times New Roman';">frameset</span></li><li><span style="font-family: 'Times New Roman';">noframe</span></li><li><span style="font-family: 'Times New Roman';">applet</span></li><li><span style="font-family: 'Times New Roman';">big</span></li><li><span style="font-family: 'Times New Roman';">center</span></li><li><span style="font-family: 'Times New Roman';">basefront</span></li></ul>
3. What new form elements does HTML5 have?
HTML5 adds many new form elements for developers to build better Web applications.
<ul><li><span style="font-family: 'Times New Roman';">datalist</span></li><li><span style="font-family: 'Times New Roman';">datetime</span></li><li><span style="font-family: 'Times New Roman';">output</span></li><li><span style="font-family: 'Times New Roman';">keygen</span></li><li><span style="font-family: 'Times New Roman';">date</span></li><li><span style="font-family: 'Times New Roman';">month</span></li><li><span style="font-family: 'Times New Roman';">week</span></li><li><span style="font-family: 'Times New Roman';">time</span></li><li><span style="font-family: 'Times New Roman';">color</span></li><li><span style="font-family: 'Times New Roman';">number</span></li><li><span style="font-family: 'Times New Roman';">range</span></li><li><span style="font-family: 'Times New Roman';">email</span></li><li><span style="font-family: 'Times New Roman';">url</span></li></ul>
4. What new APIs does HTML5 provide?
<ul><li><span style="font-family: 'Times New Roman';">Media API</span></li><li><span style="font-family: 'Times New Roman';">Text Track API</span></li><li><span style="font-family: 'Times New Roman';">Application Cache API</span></li><li><span style="font-family: 'Times New Roman';">User Interaction</span></li><li><span style="font-family: 'Times New Roman';">Data Transfer API</span></li><li><span style="font-family: 'Times New Roman';">Command API</span></li><li><span style="font-family: 'Times New Roman';">Constraint Validation API</span></li><li><span style="font-family: 'Times New Roman';">History API</span></li></ul>
5. How to embed audio in HTML5?

HTML5 supports audio in MP3, Wav, and Ogg formats. The following is a simple example of embedding audio in a webpage:
<audio controls>           <source src=”jamshed.mp3″ type=”audio/mpeg”> Your browser does’nt support audio embedding feature.  </audio>
6. How to embed videos in HTML5?
Similar to audio, HTML5 supports MP4, WebM, and Ogg videos. The following is a simple example:
<video width=”450″ height=”340″ controls>         <source src=”jamshed.mp4″ type=”video/mp4″>     Your browser does’nt support video embedding feature.  </video>
7. In addition to audio and video, what media tags does HTML5 have?
HTML5 provides strong support for multimedia. In addition to audio and video tags, it also supports the following tags:
<Embed> labels define embedded content, such as plug-ins. <Embed type = "video/quicktime" src = "Fishing. mov"> <source> is useful for defining multiple data sources. <Video width = "450" height = "340" controls> <source src00000000jamshed.mp4 "type =" video/mp4 "> <source src000000000000jamshed.ogg" type = "video/ogg"> </ video>
<Track> labels define external text tracks for media such as video elements. It is used to specify subtitle files or other files containing text that are visible during media playback.
<video width=”450″ height=”340″ controls>            <source src=”jamshed.mp4″ type=”video/mp4″>            <source src=”jamshed.ogg” type=”video/ogg”>            <track kind=”subtitles” label=”English” src=”jamshed_en.vtt” srclang=”en” default></track>             <track kind=”subtitles” label=”Arabic” src=”jamshed_ar.vtt” srclang=”ar”></track>  </video>
8. What is the use of HTML5 Canvas elements?
The Canvas element is used to draw images on a web page. The element tag is powerful in that it can be used to perform graphic operations directly on HTML, <canvas id = "canvas1" width = "300" height = "100"> </canvas>
9. What are the differences between HTML5 Storage types?
HTML5 can store data locally. Previously, cookies were used. HTML5 provides the following two local storage solutions:
  • LocalStorage is used for persistent local storage. The data will never expire and the browser will not be lost.
  • SessionStorage can only access pages in the same session and the data will be destroyed after the session ends. SessionStorage is not a persistent local storage, but a session-level storage.
10. What is the difference between HTML5 application cache and browser cache?
Application caching is one of the important features of HTML5. It provides offline functions that allow applications to obtain local website content, such as HTML, CSS, images, and JavaScript. This feature can improve website performance. Its implementation is based on the manifest file, as shown below: <! Doctype html>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.