你什么时候开始使用HTML 5? [英] When will you start using HTML 5?

查看:82
本文介绍了你什么时候开始使用HTML 5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,HTML5已经被广泛宣传,预计将于2022年准备 。这是一个需要等待的时间很长的时间,对此准备情况的测试是:至少有两个浏览器要完全通过[HTML 5测试套件]。



很明显,浏览器通过这个测试之前,他们必须开始实现可用的HTML 5功能。 支持的新HTML5功能列表目前看起来很薄弱。但是有一些现有元素的重大变化,如允许A标记环绕块级别,现在可能非常有用。



有些网站是现在使用HTML 5 那么有哪些因素可以让你开始或者阻止用HTML 5文档类型构建网站?



我自己,我在两个个人站点中使用HTML5,但是会等待工作站点,直到可靠的验证器出现为止。

解决方案

它有助于将这个问题分成几个部分。

1)何时应该开始使用HTML5文档类型?



HTML5 doctype会导致浏览器以完全标准模式呈现页面。除非您正在使用严格的文档类型,否则页面可能会以不同的方式显示。因此,如果您要转换现有网站,则需要权衡所需的返工量,并且您需要了解呈现行为的差异。 其次,doctype将使w3c验证程序选择HTML5作为默认语言进行验证。鉴于HTML5仍处于草稿中,这意味着要瞄准移动目标。有效性对你很重要吗? HTML5中有效的一些功能目前在HTML5中无效。如果您现在要更改标记以删除这些功能,那么考虑到HTML5可能会更改以使这些功能再次有效?如果您对此感到满意,现在就可以开始使用HTML5文档了。

另一方面,在它自己的基础上,您获得了什么?如果您希望浏览器以完全标准模式呈现,您可以使用HTML 4.01或XHTML 1.x中严格的文档类型。您是否需要HTML5验证,因为它会传递目前可能无法在整个浏览器中一致处理的内容?请注意,目前在浏览器中工作的任何HTML5功能,无论您是否使用HTML5文档类型,都可以使用。



2)何时应该开始使用功能目前在主流浏览器中可以互操作实现,但在HTML5中首次实现了标准化?

现在可以使用这些,但要确保您的页面可以正常访问。例如,Canvas不会为无视力的用户提供良好的支持。


3)何时应该开始使用当前在某些浏览器中实现的功能,并将通过HTML5标准化?



这取决于您的目标用户和交付时间表。在您的网站上线之前,您的用户是否会使用支持这些功能的浏览器?如果他们不这样会怎样?页面是否优雅地回落?您是否在意某些用户无法使用您的网站?

4)何时应该开始使用尚未实现的HTML5功能? / strong>



您为什么要这么做?这对于培训目的或调查回退行为可能是合理的,但HTML5仍处于草稿形式,并且很可能某些功能永远不会实现,或者将以完全不同于目前所描述的方式实施,因此您可以浪费了大量的精力。



总结,重要的不在于HTML5草案中的内容,而是今天实际可用的内容。该草案描述了一系列功能,其中一些功能多年来一直在浏览器中,其中一些功能虽然新颖但具有支持或良好的回退行为,还有一些功能目前并不可用,并且可能永远无法使用。



对我来说,我会一直等到我需要HTML5功能,并且我知道该功能在主流浏览器中以一致且稳定的方式实现。这可能会在HTML5的最后一次调用阶段,或可能在候选推荐阶段期间发生。


So HTML 5 has been widely publicised as expected to be ready in 2022. This is a long time to wait, and the test for that readiness is that "at least two browsers to completely pass [HTML 5 test suites]"

Obviously for browsers to pass this test they have to start implementing usable HTML 5 features before that. The list of new HTML5 features supported is looking thin at the moment. But there are a couple of significant changes to existing elements such as allowing A tags to surround block level that could be very useful now.

There are sites that are using HTML 5 now, so what are the factors that will make you start, or keep you from, building sites with an HTML 5 doctype?

Myself, I'm toying with HTML5 in a couple of personal sites, but will wait a while for work sites until things like a reliable validator appear.

解决方案

It helps to divide this question into several parts.

1) When should one start using the HTML5 doctype?

The HTML5 doctype causes browsers to render pages in Full Standards mode. Unless you're currently using a strict doctype, pages may display differently. So you'll need to weigh up the amount of rework required if you're converting a existing site, and you'll need to understand the difference in rendering behaviour. Secondly, the doctype will cause the w3c validator to select HTML5 as the default language to validate against. Given that HTML5 is still in draft, this means aiming at a moving target. Is validity important to you? Some features that are valid in HTML4 are not currently valid in HTML5. Should you change your markup now to remove those features, given that HTML5 may change to make those features valid again? Provided you're comfortable with this, you can start using the HTML5 doctype now.

On the other hand, on it's own, what are you gaining? If you want browsers to render in Full Standards mode, you can use a strict doctype from HTML 4.01 or XHTML 1.x. Do you need HTML5 validation given that it will pass things that may not at present be handled consistently across browsers? Be aware that any HTML5 feature that currently works in browsers, works regardless of whether you use the HTML5 doctype or not.

2) When should one start using features that are currently interoperably implemented in the major browsers, but standardised for the first time in HTML5?

You can use these now, but try to make sure that your pages are properly accessible. Canvas, for example, does not provide good support for non-sighted users.

3) When should one start using features that are current implemented in some browsers, and will be standardised by HTML5?

This depends on your target users and delivery schedules. Will your users be using a browser that supports these features by the time your site goes live? What happens if they don't? Does the page fall back gracefully? Do you care if some users can't use your site?

4) When should one start using features of HTML5 that are not implemented at all yet?

Why would you want to do that? It might be reasonable for training purposes or investigating fall back behaviour, but HTML5 is still in draft form, and it's quite possible that some features will never be implemented, or will be implemented in a totally different way to that currently described, so you could waste a lot of effort.

Summarising, what matters is not so much what's in the HTML5 draft, as what is practically usable today. The draft describes a range of features, some of which have been in browsers for years, some which are new but have support or good fall back behaviour, and some which are not currently and may never be usable.

For me, I'll be holding off until I need an HTML5 feature, and I know that that feature is implemented in a consistent and stable way across the major browsers. That will probably happen some time during HTML5's Last Call phase, or possibly during the Candidate Recommendation phase.

这篇关于你什么时候开始使用HTML 5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆