为什么HTML 5仍然支持演示元素? [英] Why HTML 5 still have support for Presentational elements?

查看:156
本文介绍了为什么HTML 5仍然支持演示元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参阅此处的列表:

http://www.w3schools.com/html5/html5_reference.asp

< b> < i> < br> < hr> < small>

使用这些是否意味着没有利弊?但内容和演示分离呢?

Is it means no cons to use these? But what about content and presentation seperation?

推荐答案

有两个原因可以理解:


  1. 因为有些人(不是我,这里有关于这个意见的入门书这里是WHATWG常见问题解答)不要认为它们是表现性的。他们认为,< b> 具有自己的语义,例如,< strong> 不是是的,文本应该是粗体的(恕我直言,因此我们有< span>

  1. Because some people (not me, here is a primer about this opinion and here are the WHATWG FAQ about this) don't think of them as presentational. They argue, that <b> has semantics of its own, for example, where <strong> is not right and the text should be bold anyways (IMHO therefore we have <span>)

因为HTML5具有实用且向后兼容的方法:HTML4中的工作原理也适用于HTML5。他们认为,这就是XHTML2死亡的原因。

Because HTML5 has a pragmatic and backwards compatible approach: What worked in HTML4 should work too in HTML5. They argue, that this is why XHTML2 died.

这篇关于为什么HTML 5仍然支持演示元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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