10 most common HTML5 questions and answers

Source: Internet
Author: User

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

The HTML5 document type is simple:

<! DOCTYPE HTML >

2. How to embed audio in HTML5?

HTML5 supports MP3, Wav, and OGG-formatted audio, here's a simple example of embedding audio in a Web page:

<controls>    <srctype = "Audio/mpeg" >     Your Browser does ' NT support audio embedding feature. </ Audio >

3, how to embed video in HTML5?

Like audio, HTML5 supports videos in MP4, WebM, and OGG formats, and here's a simple example:

<widthheightcontrols>  <  src type = "Video/mp4″ > Your     Browser does ' NT support video embedding feature. </ Video >

One thing to emphasize here is that controls= "true", controls= "controls", is the wrong use in HTML5.

For defining multiple data sources you can write this:

<Videowidth= "450″Height= "340″Controls>     <Sourcesrc= "T.mp4″type= "Video/mp4″>     <Sourcesrc= "T.ogg"type= "Video/ogg"></Video>

Specify a caption file or other file that contains text for the video element

<Videowidth= "450″Height= "340″Controls>     <Sourcesrc= "T.mp4″type= "Video/mp4″>     <Sourcesrc= "T.ogg"type= "Video/ogg">     < TrackKind= "Subtitles"label= "中文版"src= "T_EN.VTT"Srclang= "en"default></ Track>     < TrackKind= "Subtitles"label= "Arabic"src= "T_AR.VTT"Srclang= "AR"></ Track></Video>

4. What media labels are available in addition to audio and VIDEO,HTML5?

HTML5 provides strong support for multimedia, with the following tags supported in addition to audio and video tags:

<embed> tags define embedded content, such as plugins.

<typesrc= "Test.mov">

5. What is the use of HTML5 Canvas elements?

The Canvas element is used to draw a graphic on a Web page, and the element tag is powerful in that it can be graphically manipulated directly on HTML

<IDwidthheight= "100″> </canvas>

...

10 most common HTML5 questions and answers

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.