为什么HTML5中不支持字体标签? [英] Why is the font tag not supported in HTML5?

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

问题描述

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



对我来说这似乎完全符合逻辑,你有一段文字并且只是希望使用字体标签更改字体或标识其中的行或字,现在唯一的方法就是使用span标签。
我觉得有很多方法可以创建一个文本块,使用div,section或者段落,但是为了包装一些关键字或者任何内联内容,只有span标签。 / p>

真的,一个小标签不会有什么坏处,为什么不支持它?

谢谢你,



Luke

解决方案

总之:



HTML是一种标记语言。使用它来使用最符合语义的元素来标记内容的不同部分。



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



使用< font> 标记进行造型,而不是标记内容的一部分。这就是为什么它被弃用的原因,以及其他不在场的标签,如< center>


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

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 tag, now the only way to do the job is with the span tag. 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 tag.

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

Thank you,

Luke

解决方案

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> tag was used for styling, not marking up a section of your content. That's why it's deprecated, along with other out-of-place tags such as <center>.

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

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