The <font> tag was widely used in older versions of HTML and still needed in todays tech!

The <font> tag was widely used in older versions of HTML (up to HTML 4) to change text color, size, and typeface. However, it’s deprecated in HTML5—today we use CSS instead. Still, here are some classic examples so you can see how it worked:

 

✅Basic Syntax

html
 
<font size="3" color="blue" face="Arial">This is styled text</font>

✅Examples

 
  1. Changing Text Color

 
html
 
<font color="red">This text is red</font>
<font color="#1c87c9">This text is blue (hex code)</font>
 
  1. Changing Font Size

 
html
 
<font size="1">Tiny text</font><br>
<font size="3">Normal text</font><br>
<font size="7">Very large text</font>
 

(Size ranges from 1 to 7, with 3 as the default.)

 
  1. Changing Font Face

 
html
 
<font face="Verdana">This text is in Verdana</font><br>
<font face="Courier New">This text is in Courier New</font>
 
  1. Combining Attributes

 
html
<font size="5" color="green" face="Times New Roman">
Big green Times New Roman text
</font>
 
 

✅ Modern Equivalent (CSS)

Instead of <font>, you’d now write:


html

<p style="font-size:20px; color:green; font-family:'Times New Roman';"> Big green Times New Roman text </p> 

 
 
 
 
The <font> tag is useful to know for legacy code or when maintaining older sites, but for new projects, CSS is the standard.
 

Would you like me to put together a side‑by‑side comparison table of <font> vs. CSS so you can see exactly how to translate old code into modern best practice?