10 most common HTML5 Interview Questions and Answers, html5 Questions and answers

Source: Internet
Author: User

10 most common HTML5 Interview Questions and Answers, html5 Questions and answers

1. What is the new HTML5 document type and character set?

HTML5 document type is simple:

<!doctype html>

2. 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=”test.mp3″ type=”audio/mpeg”>    Your browser does’nt support audio embedding feature.</audio>

3. 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=”t.mp4″ type=”video/mp4″>   Your browser does’nt support video embedding feature.</video>

The following points must be emphasized: controls = "true", controls = "controls" is incorrect in html5.

You can write multiple data sources as follows:

<video width=”450″ height=”340″ controls>     <source src=”t.mp4″ type=”video/mp4″>     <source src=”t.ogg” type=”video/ogg”></video>

Specify subtitle files or other files containing text for the video Element

<video width=”450″ height=”340″ controls>     <source src=”t.mp4″ type=”video/mp4″>     <source src=”t.ogg” type=”video/ogg”>     <track kind=”subtitles” label=”English” src=”t_en.vtt” srclang=”en” default></track>     <track kind=”subtitles” label=”Arabic” src=”t_ar.vtt” srclang=”ar”></track></video>

 

4. 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=”test.mov”>

5. What is the use of HTML5 Canvas elements?

The Canvas element is used to draw a graph on a webpage. The element tag is powerful in that it can be used for graphic operations directly on HTML.

<canvas id=”canvas1″ width=”300″ height=”100″></canvas>

...

 

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.