为什么HTML5不支持字体元素

为什么HTML5不支持字体元素

本文介绍了为什么HTML5不支持字体元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很好奇,希望有人能在W3C的疯狂中揭示这种方法.在最新的HTML5标准中不支持此元素的原因是什么?我知道HTML 4.01中已弃用该元素,但我不明白为什么.

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 know the element was deprecated in HTML 4.01, but I don't understand why.

在我看来,这很合乎逻辑,您有一段文本,只是想更改字体,或者使用font元素从中识别出线条或单词,现在唯一的方法就是使用span元素.对于我来说,很奇怪的是,有这么多种方法可以使用div,section或仅段落来创建文本块,但是要包装一些关键字或任何内联内容,只有span元素.

It seemed perfectly logical to me, you have a a paragraph of text and just wish to change the font, or to identify, lines or words from it using the font element, now the only way to do the job is with the span element.It seems strange to me that there are so many ways to create a block of text, using div, section, or just paragraph, but to wrap a few keywords or any inline content, there is only the span element.

实际上,一个小要素不会造成任何伤害,那么为什么不仍然支持它呢?

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

谢谢

卢克

推荐答案

简而言之:

HTML是一种标记语言.使用它可以使用语义上最准确的元素标记内容的不同部分.

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

CSS用于样式目的,例如更改颜色,大小,字体等.

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

<font>元素用于样式设置,而不是标记内容的一部分.这就是为什么不推荐使用它以及其他不适当的元素(如<center>)的原因.

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

这篇关于为什么HTML5不支持字体元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 20:48