当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML 字体

HTML
HTML Head
HTML Meta
HTML URLs
HTML Scripts
HTML 属性
HTML 事件
HTML URL-encode
HTML Web服务器
HTML 摘要
HTML 实例
标签列表
标准属性
事件属性
ASCII码
特殊字符
HTTP状态消息

HTML 字体


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 1097 ::
收藏到网摘: n/a

The <font> tag in HTML is deprecated. It is supposed to be removed in a future version of HTML.
<font>标签在HTML里是不被推荐的。在下个版本的HTML中这个标签会被移除。

Even if a lot of people are using it, you should try to avoid it, and use styles instead.
哪怕依然有很多人在使用它,你也应该尝试去避免使用它,而用样式来取代它。


The HTML <font> Tag
HTML的<font>标签

With HTML code like this, you can specify both the size and the type of the browser output :
通过下面这些代码,你可以指定字体在浏览器显示的大小和风格:

<p>
<font size="2" face="Verdana">
This is a paragraph.
</font>
</p>
<p>

<font size="3" face="Times">
This is another paragraph.
</font>
</p>

Try it yourself
你自己尝试下吧!

Font Attributes
字体属性

Attribute
属性
Example
例子
Purpose
目的
size="number" size="2" Defines the font size
定义字体大小
size="+number" size="+1" Increases the font size
增加字体大小
size="-number" size="-1" Decreases the font size
减小字体大小
face="face-name" face="Times" Defines the font-name
定义字体名称
color="color-value" color="#eeff00" Defines the font color
定义字体颜色值
color="color-name" color="red" Defines the font color
定义字体颜色名称

 


The <font> Tag Should NOT be Used
不应该使用的<font>标签

The <font> tag is deprecated in the latest versions of HTML (HTML 4 and XHTML).
在最新的HTML版本中(HTML4和XHTML)<font>标签是不被推荐的

The World Wide Web Consortium (W3C) has removed the <font> tag from its recommendations. In future versions of HTML, style sheets (CSS) will be used to define the layout and display properties of HTML elements. 
W3C组织已经将<font>标签从它的推荐中删除,将来版本的HTML,样式表(css)将会被使用来定义布局以及显示HTML各元素的属性。


The Right Way to Do It - With Styles
使用正确的方法来做-使用样式

Set the font of text
设置文字的字体
This example demonstrates how to set the font of a text.
这个案例展示了如何设置文本中的字体属性。

Set the font size of text
设置文字的大小
This example demonstrates how to set the font size of a text.
这个案例展示了如何设置文本中的字体大小。

Set the font color of text
设置文字的颜色
This example demonstrates how to set the color of a text.
这个案例展示了如何设置文本中的字体颜色。

Set the font, font size, and font color of text
设置文字的大小、字体、颜色
This example demonstrates how to set the font, font size, and font color of a text.
这个案例展示了如何设置文本中的字体、字体大小以及字体颜色。


Where to Learn More About Style Sheets?
到哪里去学习更多的样式表?

First off: Finish the last chapters in our HTML tutorial !!! In the following chapters we will explain why some tags, like <font>, are to be removed from the HTML recommendations, and how to insert a style sheet in an HTML document.
首先: 完成我们HTML教程的最后几章!!在接下来的章节我们会解释为什么一些标签,像<font>,会从推荐中删除还有就是怎样在一个HTML文档中插入一个样式表。

To learn more about style sheets: Study our CSS Tutorial.
学习有关样式表的知识可以进入我们的CSS教程

评论 (0) All

登陆 | 还没注册?