HTML & CSS Wiki
Register
2rekt (talk | contribs)
No edit summary
No edit summary
 
Line 1: Line 1:
  +
{{DISPLAYTITLE:{{HTML tag|font}}}}
{{Title|<nowiki><font></nowiki>}}
 
{{Bad|'''deprecated''', '''[[Separation of Layers|presentational]]''' element}}
 
{{TagInfobox
 
| usage = <source lang="html4strict"><font face="Arial" color="blue" size="+5">
 
TEXT</font></source>
 
| spec =
 
| deprecated = 4.0
 
| msie =
 
| firefox =
 
| gchrome =
 
| safari =
 
| opera =
 
| example = <font face="Arial" color="blue" size="+5">TEXT</font>
 
}}
 
   
 
{{Bad|'''deprecated''', '''[[Separation of Layers|presentational]]''' element}}
  +
{{Infobox element|name = {{HTML tag|font}}|element-type = Container|html-version = HTML 3.2|spec-version = 3.2|status = Obsolete|categories = Phrasing content|content-model = Phrasing content|dom-interface = HTMLFontElement}}
 
The [[HTML]] '''<code>&lt;font&gt;&lt;/font&gt;</code>''' element has been deprecated since HTML4 in favor of [[CSS]] [[Font (CSS)|font]] properties. It was used to render the font color, font size, and font face for the selected text. It is now obsolete in [[HTML5]].
 
The [[HTML]] '''<code>&lt;font&gt;&lt;/font&gt;</code>''' element has been deprecated since HTML4 in favor of [[CSS]] [[Font (CSS)|font]] properties. It was used to render the font color, font size, and font face for the selected text. It is now obsolete in [[HTML5]].
  +
 
{{Clrr}}
 
{{Clrr}}
 
===Attributes===
 
===Attributes===
Line 41: Line 31:
 
For font face names that contain more than one word, make sure they are contained in double quotes (""), so that it will be rendered correctly.
 
For font face names that contain more than one word, make sure they are contained in double quotes (""), so that it will be rendered correctly.
   
  +
Example:
Example: <source lang="html4strict"><font face="Arial Black">TEXT</font></source>
 
  +
 
<source lang="html4strict"><font face="Arial Black">TEXT</font></source>
   
 
==External Links==
 
==External Links==

Latest revision as of 02:59, 1 December 2019


This deprecated, presentational element is not recommended. Authors should generally find an alternative way to accomplish the same task while adhering to all best practices, or simply do without it if it is unimportant.


The HTML <font></font> element has been deprecated since HTML4 in favor of CSS font properties. It was used to render the font color, font size, and font face for the selected text. It is now obsolete in HTML5.

Attributes

Attribute Value Description
face font name Allows selection of font face for the text. Ex. Arial, Eurostile, Courier, etc. See font-family.
color color Allows selection of the font color. Valid color names or color codes are accepted. See color.
size number Allows selection of font size through number value. A plus sign (+) or minus sign (-) may be added in front of the number for a font size one level bigger, one level smaller, etc. See font-size.
Global Attributes

See Global HTML Attributes.


HTML example:

<font face="Eurostile" color="green" size="20">Font element in action.</font>


That generates: Font element in action.

For font face names that contain more than one word, make sure they are contained in double quotes (""), so that it will be rendered correctly.

Example:

<font face="Arial Black">TEXT</font>

External Links