用AI赚第一桶💰低成本搭建一套AI赚钱工具,源码可二开。 广告
# HTML &lt;font&gt; 标签 ## 定义和用法 &lt;font&gt; 规定文本的字体、字体尺寸、字体颜色。 ## 实例 规定文本字体、大小和颜色: ``` <font size="3" color="red">This is some text!</font> <font size="2" color="blue">This is some text!</font> <font face="verdana" color="green">This is some text!</font> ``` ## 浏览器支持 | IE | Firefox | Chrome | Safari | Opera | | --- | --- | --- | --- | --- | 所有主流浏览器都支持 &lt;font&gt; 标签。 ## HTML 与 XHTML 之间的差异 在 HTML 4.01 中,font 元素不被赞成使用。 在 XHTML 1.0 Strict DTD 中,font 元素不被支持。 ## 提示和注释: 提示:请使用样式(代替 &lt;font&gt;)来[定义文本的字体、字体颜色、字体尺寸](/css/css_text.asp "CSS 文本")。 ## 可选的属性 | 属性 | 值 | 描述 | | --- | --- | --- | | [color](/tags/att_font_color.asp "HTML &lt;font&gt; 标签的 color 属性") | _rgb(x,x,x)_ _#xxxxxx_ _colorname_ | 不赞成使用。请使用样式取代它。规定文本的颜色。 | | [face](/tags/att_font_face.asp "HTML &lt;font&gt; 标签的 face 属性") | *font_family* | 不赞成使用。请使用样式取代它。规定文本的字体。 | | [size](/tags/att_font_size.asp "HTML &lt;font&gt; 标签的 size 属性") | _number_ | 不赞成使用。请使用样式取代它。规定文本的大小。 | ## 标准属性 ``` id, class, title, style, dir, lang, xml:lang ``` 如需完整的描述,请访问[标准属性](/tags/html_ref_standardattributes.asp)。 ## 事件属性 ``` NONE ``` 如需完整的描述,请访问[事件属性](/tags/html_ref_eventattributes.asp)。 ## TIY 实例 [设置文字的字体](/tiy/t.asp?f=html_font-family "Set the font of text") 本例演示如何设置文字的字体。 ``` <html> <body> <h1 style="font-family:verdana">A heading</h1> <p style="font-family:courier">A paragraph</p> </body> </html> ``` [设置文字的尺寸](/tiy/t.asp?f=html_font-size "Set the font size of text") 本例演示如何设置文字的尺寸。 ``` <html> <body> <h1 style="font-size:150%">A heading</h1> <p style="font-size:80%">A paragraph</p> </body> </html> ``` [设置文字的颜色](/tiy/t.asp?f=html_color "Set the font color of text") 本例演示如何设置文字的颜色。 ``` <html> <body> <h1 style="color:blue">A heading</h1> <p style="color:red">A paragraph</p> </body> </html> ``` [设置文字的字体、字体尺寸、字体颜色](/tiy/t.asp?f=html_fontall "Set the font, font size, and font color of text") 本例演示如何设置文字的字体、字体尺寸、字体颜色. ``` <html> <body> <p style="font-family:verdana;font-size:80%;color:green"> This is a paragraph with some text in it. This is a paragraph with some text in it. This is a paragraph with some text in it. This is a paragraph with some text in it. </p> </body> </html> ```