HTML5语义标记的降级问题(文章,页脚,标题) [英] Degradation issues for HTML5 semantic tags (article, footer, header)

查看:210
本文介绍了HTML5语义标记的降级问题(文章,页脚,标题)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HTML5中的新布局标记的效果如何?使用它们有什么危害? (我不是在谈论< video> - 我看到了具体的后备代码。)

How well do the new layout tags in HTML5 degrade? What are the hazards in using them? (I'm not talking about <video>--I've seen specific fallback code for it).

具体来说,在

<html>
<head></head>
<body>
<header>
<h1>Talking Dogs</h1>
<b><p>Humans aren't the only talkers!</p></b>
</header>
<article>
<p>Ever encountered a talking dog? I have.</p>
<p>It all happened one day as I was walking down the street...</p>
</article>
<footer>
© 2009 Woofer Dog Corporation
</footer>
</body>
</html>

将使用< header> code>< article> 或< footer> 导致任何浏览器问题?他们在不支持的浏览器中自动降级到< div> 吗?

Would using <header>, <article>, or <footer> cause any browser problems? Do they degrade to <div> in unsupporting browsers automatically? Or if I include them, should I only include them for semantic meaning, and not for CSS styling or DOM scripting?

推荐答案

如果我包含它们,我应该只包含它们的语义含义,而不是CSS样式或DOM脚本?只要您使用 html5shiv 处理IE,就可以正常工作。

As long as you use html5shiv to handle IE, it will work fine.

浏览器会将所有未知标记(包括HTML5标记)视为正常内联元素。

您应该包含以下CSS规则:

The browser will treat all unknown tags (including HTML5 tags) as normal inline elements.
You should include the following CSS rule:

article, aside, figure, footer, header, hgroup,
menu, nav, section { display: block; }

这篇关于HTML5语义标记的降级问题(文章,页脚,标题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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