比较 HTML 和 HTML5
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18164603/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Compare HTML and HTML5
提问by ankakusu
I've been making research about the tools that a front end developer shall know. Now, I'm focused on HTML and I have some questions that are listed below:
我一直在研究前端开发人员应该知道的工具。现在,我专注于 HTML,我有一些问题列在下面:
- Since HTML5 is better than HTML and offers new tags such as header, nav, article, etc. why not everybody is not using them?
- Why there are still old tags? Or Should I prefer to use HTML5 tags or keep using HTML tags?
- Which opportunities does HTML5 offers me at all?
- Does HTML5 is supported for all of the browsers?
- 既然 HTML5 比 HTML 更好,并且提供了诸如标题、导航、文章等新标签,为什么不是每个人都没有使用它们呢?
- 为什么还有旧标签?或者我应该更喜欢使用 HTML5 标签还是继续使用 HTML 标签?
- HTML5 为我提供了哪些机会?
- 是否所有浏览器都支持 HTML5?
Do you have any comments, answers to those questions?
您对这些问题有什么意见和答案吗?
Thanks in advance..
提前致谢..
回答by Shaun
Not everyone is using them because not every legacy browser supports them. Most modern browsers dosupport HTML5 but there are still lots of folks on the internet that are using old, outdated browsers. Fortunately, some HTML5 tags have fallbackoptions in which non-supported browsers load different tags depending on who is viewing them
Old tags are still around because they are still a crucial part of the HTML structure. Lots of websites rely on these "old" tags to still function and so taking them out would break a lot of websites. There is really nothing wrong with "old" tags and it all depends on your implementation and audience. Think of HTML5 as an additionto the HTML family and not a replacement
HTML5 offers cool new tags such as
<canvas>
,<video>
,<audio>
, and more to bring the HTML language more in-line with modern times. Check out more about it at W3 here: http://www.w3schools.com/html/html5_intro.aspHTML5 is supported for most modern browsers. You can see a list of them here: http://html5test.com/results/desktop.html
并非每个人都在使用它们,因为并非每个旧版浏览器都支持它们。大多数现代浏览器都支持 HTML5,但互联网上仍有很多人在使用旧的、过时的浏览器。幸运的是,一些 HTML5 标签具有后备选项,其中不受支持的浏览器会根据查看者加载不同的标签
旧标签仍然存在,因为它们仍然是 HTML 结构的关键部分。许多网站依赖这些“旧”标签仍然有效,因此将它们删除会破坏许多网站。“旧”标签确实没有错,这完全取决于您的实施和受众。HTML5看作一个另外的HTML家庭,而不是替代
HTML5 提供了很酷的新标签,例如
<canvas>
、<video>
、 等<audio>
,使 HTML 语言更符合现代。在 W3 上查看更多相关信息:http: //www.w3schools.com/html/html5_intro.asp大多数现代浏览器都支持 HTML5。您可以在此处查看它们的列表:http: //html5test.com/results/desktop.html
回答by Ali Gajani
I agree with Shaun. HTML5 is not a replacement for HTML, but an addition. To my understanding, HTML5 offers a more semantic approach towards coding the markup for a website. Also, HTML5 features more features such as sound, audio, canvas, video and greatly supports animation. If you wish to use the older HTML tags, you may do so.
我同意肖恩。HTML5 不是 HTML 的替代品,而是一种补充。据我了解,HTML5 为网站的标记编码提供了一种更具语义的方法。此外,HTML5 具有更多的功能,如声音、音频、画布、视频,并极大地支持动画。如果您希望使用较旧的 HTML 标签,您可以这样做。
But, if you wish to keep things more semantically accurate, use the HTML5 tags like <header>, <footer>, <aside>
etc. HTML5 is still under development so it will be some time till all browsers support it. However, you might already be using plenty of HTML5 and CSS3 elements if you are using a framework like Bootstrap and it pretty much works on many browsers (except for infamous IE).
但是,如果您希望在语义上更准确,请使用 HTML5 标签<header>, <footer>, <aside>
等。HTML5 仍在开发中,因此需要一段时间才能让所有浏览器都支持它。但是,如果您使用的是像 Bootstrap 这样的框架,那么您可能已经在使用大量 HTML5 和 CSS3 元素,并且它几乎适用于许多浏览器(臭名昭著的 IE 除外)。
回答by CCCP
HTML5 is supported by every modern browser. HTML5 is the successor of HTML4, it's just the newest HTML. HTML5 offers a lot of things, see here for example: http://www.html5test.com/This website will also tell you what features are supported by your browser.
每个现代浏览器都支持 HTML5。HTML5 是 HTML4 的继承者,它只是最新的 HTML。HTML5 提供了很多东西,例如参见这里:http: //www.html5test.com/该网站还会告诉您浏览器支持哪些功能。
One great thing about HTML5 is the ability to show animations and videos without a plug-in.
HTML5 的一大优点是无需插件即可显示动画和视频。