How to use HTML5 on your website today

还有的是很多写了关于政治和新兴的HTML5规范的过程(见“What to expect from HTML5" and "How HTML5 will change the Web," as just two examples), but what working Web developers primarily want to know is: What can I do with HTML5, and when can I start using it? The good news is that there's a lot you can do with HTML5. The better news is that there's a lot that you can do with HTML5 today.

But first, one major caveat: You need to know your audience, though, of course, this is true whether or not you want to start using HTML5. If the majority of your site's visitors still use Internet Explorer 6, then you have no reason to rush. On the other hand, if your site is primarily for mobile browsers on iPhones and iPads, what are you waiting for? But if your site falls somewhere in the middle -- as most do -- here are some handy guidelines to ramping up to HTML5.

[ Read Neil McAllister's primer: "What you can expect from HTML5。" | Find outInfoWorld's peace plan for ending the iPhone's HTML5-versus-Flash war。]

HTML5的特点是什么,你现在可以使用

Although the HTML5 specification is still a draft being worked on by a standard committee, significant portions are already deployed in Apple Safari, Google Chrome, Mozilla Firefox (with more to come in Firefox 4), and Opera -- and the forthcoming MicrosoftIE9 is expected to adopt much of the draft HTML5 specificationas well. TheWhen Can I Use site是一个很好的资源,提供的详细资料了每个主要的浏览器支持对HTML5和相关的新兴的Web标准。

Browser Security Deep Dive

Another site,The HTML5 Test, displays compatibility scores, based on the number of supported HTML5 capabilities (out of 300), for each browser (you need to visit the site in each browser you want scored). As of June 12, 2010, the scores were:

* Apple Safari 5.0: 208

* Google Chrome 5.03: 197

* Microsoft IE7: 12

* Microsoft IE8: 27

* Mozilla Firefox 3.66: 139

* Opera 10.6: 159

有明确HTML5的核心特点是所有主要非IE浏览器做支持,这可以让“HTML5草案”的网站将被部署到一个大段的网络使用人口。

从顶部开始。现在,您可以使用HTML5的DOCTYPE;没有理由不这样做。你甚至可以做一个群众查找和整个网站取代,寻找(例如):

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

Which can be turned into:

那不是更清晰和更straightf很多orward? If browsers rendered your pages as standards-compliant before, they will still do so afterward. (If the code in this article doesn't display properly, go to the original article atInfoWorld.com。)

Get moving with video. Much of the press about HTML5's video tag has been about the current format battles. There are four competitors --, H.264, Ogg, andWebM- 所有这些都希望成为未来的发挥其在所有浏览器的所有平台上的格式,没有。可悲的是,它不会出现浏览器厂商将在同意common future format任何时间很快。

Given that news, it's perfectly reasonable to jump to the conclusion that the video tag isn't ready for prime time. But wait: The bright folks behindHTML5已经预料到并提出视频格式无关。事实上,因为视频可以包含多个源标记,它结束了工作了相当不错。如果你的浏览器不支持第一个选项,它与第二再次尝试,然后再与第三个,依此类推。它甚至有效回落到Flash,并再次以一个单一的形象。

处理这种需要的HTML可以在视频中找到每个人,一个开源项目,以支持使用非JavaScript和浏览器嗅探基于Web的视频。

Semantically speaking. One of the biggest changes coming in HTML5 is semantically meaningful tags. Chances are, your site is full of tags like

Related:

Copyright © 2010足球竞彩网下载

IT Salary Survey:res的ults are in