<font>
Published Jun 18, 2022Updated Jul 31, 2023
Contribute to Docs
The <font>
element was used to set the font characteristics of a text.
Note This is now deprecated. CSS properties like the
font
property should be used instead.
Syntax
At least one of the following three attributes is required for the <font>
element. However, any combination of them can be used:
color
: What color the font/text should be. The color can be set to a namedcolor
, hexadecimal or RGB.face
: What font the text should be. For example, to have the text beverdana
, theface
attribute would be set toface="verdana"
.size
: Sets the size of the font/text. It can use absolute units and relative units ranging from 1-7. Absolute units are used bysize="5"
or any other number 1-7. Relative units are relative the size of the<basefont>
element which is also deprecated. The attribute would look something like thissize="+5"
.
Example
<font color="pink">This text is pink</font><font size="5">This size is 5</font><font face="verdana">This text is in verdana font</font>
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn HTML on Codecademy
- Career path
Front-End Engineer
Front-end engineers work closely with designers to make websites beautiful, functional, and fast.Includes 34 CoursesWith Professional CertificationBeginner Friendly115 hours - Free course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner Friendly7 hours