Beginner HTML5 Please put down the baggage, it is very easy!

Source: Internet
Author: User
Tags define

Now on the internet has been very I HTML5 study of the article before the example code, in order to learn HTML5 we have to start collecting learning so much information too numerous locks, in this article, we put some basic HTML5 merged together, convenient for us to learn in the use of convenience.

Internet Explorer does not support HTML5. We have other solutions, so what should we do?

Using Javascrip to solve the hack in IE browser

In this way, first of all, we'd like to thank a website called Html5doctor, which provides the perfect fix for the HTML5 IE browser hack, the JavaScript they provide in the tag head, so that IE can recognize the HTML5 elements, As shown here:

<article>, <aside>, <audio>, <bb>, <canvas>, <datagrid>, <datalist> < Details>, <dialog>, <eventsource>, <figure>, <footer>,

Click here to download the JavaScript download.

While using JavaScript is not the best solution, if you don't use it, you won't be able to guarantee that the page will be displayed properly in all major browsers.

HTML5 has two other problems in Firefox2 and Camino1, but they don't have a lot of market share, so we're ignoring them for a while.

2. We'll start using html5! now.

The best thing about HTML5 is that we can maximize the avoidance of duplicate code, and we don't have to define "id" or "class" for each element, because now we have a special element to define them ...

Among other elements, for your head, you can simply use the

3. Tags <video>

No one dares to really say "flash will die in HTML5", but at least to the market position of Flash will have certain influence, but HTML5 <video> label also has its own insecurity factor that is the video on the webpage many people can download, does not imitate us to change the angle to consider, Why do they want to download it? Because they like, our website content can let the user like that our website has achieved the goal.

Use <video> tags as follows: <video src=video.ogv></video><p> If your browser is not viewable please download: <a href= "VIDEO.OGV" > Download video</a>

In fact, you can do a lot of things, such as adding control button, keyboard control, subtitles in different languages and so on.

browsers automatically detect video in different formats: <video width=320 height=240 controls> <source src= "VIDEO.OGV" type= "> <" SOURCE src= "Video.mp4″type=" video/mp4″>

4. This is one of the biggest developments: Form validation!

Unfortunately, it's not supported by most browsers.

<input type= "Email" required> <input type= "Date" > <input type= "url" > There are automatic Spotlight <input type= "emails like this "Required autofocus>

Although HTML5 has not fully supported, the final HTML5 of the specification is not even finished, but this does not affect our learning, because he will be the next specification, clumsy birds have bar



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.