Skip to content Skip to sidebar Skip to footer

Why Is The Font Element Not Supported In Html5?

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 standard? I k

Solution 1:

In short:

HTML is a markup language. Use it to mark up the different sections of your content using the most semantically accurate element.

CSS is used for styling purposes, such as changing colors, sizes, fonts, etc.

The <font> element was used for styling, not marking up a section of your content. That's why it's deprecated, along with other out-of-place elements such as <center>.

Solution 2:

HTML tags describe their contents. To mark up your HTML you should use CSS. In such way you can create different skins for the same information. Since the font tag serves purely visual purpose, it has no place in HTML; it does not describe the contents.

With describing contents I mean: "This is paragraph of text / this is a time / this is a link to another page / this is the title of this article / this is a list of related terms / this is a table containing test results" etc.

Read up on semantic HTML, it will hopefully make things more clear for you.

Solution 3:

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 (<em>, <cite>, <dfn>, 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).

Post a Comment for "Why Is The Font Element Not Supported In Html5?"