新网站 - XHTML 1 Strict 或 HTML 5

发布于 2024-09-13 01:54:35 字数 283 浏览 8 评论 0原文

我将在接下来的几周内开始一个非常大的项目,并试图决定是否应该跳入 HTML5 领域,还是坚持我所信赖的严格 XHTML 1。

该网站将会很大。数千个页面、视频、自定义 CMS 系统、大量社交媒体集成等。我试图证明使用新技术的合理性,但不确定(因为我从未在 5 年内完成过大型网站)是否一切都会顺利进行计划使用较旧的浏览器。

我可以坐在那里整天谈论 html5 带来的新技术,但是当你坐在挤满高管的董事会会议室中,而该网站无法在他们的 IE6 机器上运行时……那就不好了。

让我知道你们会做什么。 - 谢谢

I'm beginning a very large project in the coming weeks and am trying to decide if I should take the leap into HTML5 land or stick with my time trusted XHTML 1 strict.

The site will be huge. Thousands of pages, video, custom CMS system, lots of social media integration, etc. I'm trying to justify using the new technology, but am unsure (as I've never done a huge site in 5) if everything will go according to plan on older browsers.

I can sit there and talk all day long about the new technology that html5 brings, but when you're sitting in a board room full of execs and the site doesn't work on their IE6 machines...not good.

Let me know what you guys would do. - Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

浅沫记忆 2024-09-20 01:54:36

选择使用 HTML5 词汇表与是否使用 XHTML 语法是一个正交问题。如果您想使用 HTML5 元素并仍然使用 XML 制作工具,那么您始终可以使用 XHTML5。

HTML5 尚未完成,因此在某种程度上,您将使用未知数量的文档类型来标记文档,并且验证它并不那么容易。但是,如果您的项目将在任何时候使用 等元素,那么使用 HTML5 文档类型是有意义的。 (尽管希望如果您使用的是自定义 CMS,那么将来调整它吐出的文档类型应该相对简单?)

这些都与 IE6 兼容性无关。 IE6-8 将以与任何标准模式文档类型相同的方式呈现页面,并且无论您是否使用 HTML5 文档类型,都不会呈现 。您肯定需要使用任何 HTML5 扩展程序,例如 的 Flash。扩展的 HTML5 语义元素,如

,无论如何你都没有真正得到任何东西可以使用;暂时避开它们。

Choosing to use the HTML5 vocabulary is an orthogonal issue to whether to use XHTML syntax. If you want to use HTML5 elements and still work with XML production tools, you can always use XHTML5.

HTML5 is not yet finished so to some extent you will be labelling your documents with a doctype of unknown quantity, and validating it isn't as easy. But if your project is going to be using elements like <video> at any point, using an HTML5 doctype makes sense. (Though hopefully if you are using a custom CMS it should be relatively straightforward to adjust the doctype it spits out in the future anyway?)

None of this is relevant to IE6 compatibility as such. IE6-8 will render the page the same with any of the Standards Mode doctypes, and won't ever render <video> regardless of whether you're using an HTML5 doctype. You will certainly need fallback for any HTML5 extensions you use, such as Flash for <video>. The extended HTML5 semantic elements like <section> or <article>, you don't really get anything for using anyway; avoid them for now.

浅暮の光 2024-09-20 01:54:36

虽然 HTML5 尚未完全完成,但其中大部分内容现在都可以使用。它的设计考虑到了兼容性,因此许多新元素可以在旧浏览器中运行,即使它们并不专门支持 HTML5。

您可以开始使用新的文档类型 - 任何浏览器都会将其识别为有效。从那里,您可以使用新的语义结构元素进行布局 - sectionasideheaderfooter等等。您需要对它们进行一些样式设置才能使它们正确显示,并且有一个用于 IE 兼容性的 shiv 脚本。这需要一些工作,但它们提供了比通用 div 更多的语义价值。

audiovideo 元素对于旧版浏览器具有后备功能,因此请务必使用它们。

各种新的表单元素和属性尚未得到广泛支持,因此您现在可能不会从它们中获得太多价值。尽管我非常期待使用它们,因为它们将大大减少对客户端脚本的需求。

IE6 是房间中显而易见的元素,但通过正确的设置并使用 HTML5 中的后备,使用 HTML5 应该不会出现严重问题。当然,CSS 是另一回事。但 IE9 看起来相当不错,将有助于提高标准支持的门槛。

While HTML5 is not fully complete, much of it can be used today. It was designed with compatibility in mind, so a number of the new elements will work in older browsers, even if they don't specifically support HTML5.

You can start using the new doctype - any browser will recognize it as valid. From there, you can do your layouts using the new semantic structural elements - section, aside, header, footer, etc. You'll need to style these a bit to get them appearing correctly, and there is a shiv script for IE compatibility. It takes a little work, but they provide much more semantic value than the generic div.

audio and video elements have fallback capabilities for older browsers, so by all means use them.

Various new form elements and attributes are not widely supported yet, so you probably won't get much value from them right now. Though I quite look forward to using them, as they will reduce need for client-side scripting a fair bit.

IE6 is the obvious element in the room, but with the right setup, and use of fallbacks in HTML5, there should be no serious issues from using HTML5. CSS is another matter, of course. But IE9 is looking rather good, and will help to raise the bar for standards support.

一城柳絮吹成雪 2024-09-20 01:54:36

HTML5 在这里是更好的选择。它提供了改进和兼容性;并将在所有浏览器中呈现。 等现代功能可以被 FLV 播放器或不兼容浏览器中的其他替代方案嗅探和替换。

XHTML 自创建以来一直是多余的,并且 XHTML 1.0(当使用正确的 mime 类型发送时)在 IE6 中根本不起作用。使用 HTML5,假设您正确处理了缺乏现代功能支持的问题,它既可以呈现又可以发挥作用。

HTML5 is a better choice here. It offers improvements as well as compatibility; and will render in all browsers. Modern features such as <video> can be sniffed for and replaced by FLV players or other alternative in non-compatible browsers.

XHTML has been redundant since its creation, and XHTML 1.0 (when sent with the correct mime type) doesn't work at all in IE6. Using HTML5, it will both render and be functional, assuming you handle the lack of support of modern features properly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文