Why HTML 5 still have support for Presentational elements?

后端 未结 3 489
我寻月下人不归
我寻月下人不归 2021-01-18 03:14

See list here:

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

like , ,
,


相关标签:
3条回答
  • 2021-01-18 03:55

    Two reasons come to mind:

    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>)

    2. 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.

    0 讨论(0)
  • 2021-01-18 03:55

    They have also redefined the meaning and semantics of several of these elements. They realized the need for an element that does something like <b> and there was already an element, so they kept it, and preserved backwards compatibility, instead of introducing something new.

    0 讨论(0)
  • 2021-01-18 04:13

    First have a look what WHATWG says about it (this is also mentioned in the answer to the related question cited above).

    It is said (as I thought, too) that <strong> and <em> provide an emphasis when using a screen reader, but according to this article by Harry Roberts, it turns out that in practice screen readers don't accentuate text marked this way.

    And last, read the spec about <b> (it's already mentioned in the FAQ in the first link, above):

    The b element represents a span of text to be stylistically offset from the normal prose without conveying any extra importance, such as key words in a document abstract, product names in a review, or other spans of text whose typical typographic presentation is boldened.

    and <i>:

    The i element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, a thought, a ship name, or some other prose whose typical typographic presentation is italicized.

    Likewise, have a look at <small>, <hr> and <br> (there are examples there, too.)

    0 讨论(0)
提交回复
热议问题