Why is the font element not supported in HTML5?

后端 未结 3 1189
萌比男神i
萌比男神i 2021-01-11 16:04

I am just curious really and hope that someone can reveal the method in the madness of the W3C. What is the reason for not supporting this element in the latest HTML5 standa

3条回答
  •  执笔经年
    2021-01-11 17:02

    There are lots of ways to wrap inline content, but only one of them has no semantics associated with it (span). Of the list of block wrappers you gave, only div has no semantics associated with it.

    The old font element has no semantics associated with it, so it contributes as much as span and can be replaced by span.

    The idea is that you pick the element that describes why the text looks different (, , , etc) and then apply CSS to make it look the way you want.

    And really, one little tag can't do any harm, so why not still support it?

    It is supported, the rendering rules describe how browsers should handle the font element. This is for backwards compatibility. Authors are just forbidden from using it (since it does no good).

提交回复
热议问题