Code has been added to clipboard!

HTML font Tag

Reading time 1 min
Published Jun 29, 2017
Updated Oct 2, 2019

HTML font Tag: Main Tips

  • The HTML <font> tag sets the font size, color and face for specified content.
  • This HTML font size tag is deprecated, meaning that we do not recommend using it.
  • Use CSS fonts instead for better functionality and browser-support.

How font Was Used

HTML <font> codes define text style.

Warning: ever since HTML4, HTML styles elements only with the style element (or as an attribute). Use CSS fonts for better control and stability.

Example
<p><font color="red" face="verdana" size="7">The text color is set to red, the font size is set to '7' and the font family is 'Verdana'.</font></p>

Note: the attribute value for the HTML font size tag is an integer (from 1 to 7). The value 1 is the smallest, 3 means the default size and 7 is the biggest font size.

Attributes for font

color

Sets text color. Not supported in HTML5. Use CSS color property as an alternative.

Example
<p><font color="red">The text color is set to red.</font></p>

face

Sets font family. Not supported in HTML5. Instead, use CSS font-family property.

Example
<p><font face="verdana">The font family is set to 'Verdana'.</font></p>

size

Sets HTML font size. Not supported in HTML5. Apply CSS font-size property for better results.

Example
<p><font size="1">The font size is set to '1'.</font></p>

Browser support

Chrome
All
Edge
All
Firefox
All
IE
All
Opera
All
Safari
All

Mobile browser support

Chrome
All
Firefox
All
Opera
All
Safari
All
Basics
Introduction
Syntax
Editors
Basic Examples
Head Section
<!DOCTYPE>
Tags and Elements
Semantic Elements
Tags Reference
Attributes
Comments
Block and Inline Elements
Forms
Form Elements
Input
Responsive Web Design
Inline Scripts
Uniform Resource Locator
Redirect
XHTML
Geolocation
Drag and Drop
Local Storage
Web Workers
Server-Sent Events
Character Encoding
Text Formatting
Quotation and Citation Elements
Headings
Paragraphs
Links
Tables
Lists
Symbols
Space
Tab
Styles
Computer Code
Layout
Classes
Colors
Images
iframes
Audio Player
Video Player
YouTube Videos
Multimedia
Canvas
SVG
<!-- -->
<a>
<abbr>
<acronym> DEPRECATED
<address>
<applet> DEPRECATED
<article>
<aside>
<audio>
<b>
<base>
<basefont> DEPRECATED
<bdi>
<bdo>
<big> DEPRECATED
<blink> DEPRECATED
<blockquote>
<body>
<br>
<button>
<canvas>
<caption>
<center> DEPRECATED
<cite>
<code>
<col>
<colgroup>
<datalist>
<dd>
<del>
<details>
<dfn>
<dialog>
<dir> DEPRECATED
<div>
<dl>
<dt>
<em>
<embed>
<fieldset>
<figcaption>
<figure>
<font> DEPRECATED
<footer>
<form>
<frame> DEPRECATED
<frameset> DEPRECATED
<h1> – <h6>
<head>
<header>
<hr>
<html>
<i>
<iframe>
<img>
<input>
<ins>
<kbd>
<keygen> DEPRECATED
<label>
<legend>
<li>
<link>
<main>
<map>
<mark>
<menu>
<menuitem> DEPRECATED
<meta>
<meter>
<nav>
<noframes> DEPRECATED
<noscript>
<object>
<ol>
<optgroup>
<option>
<output>
<p>
<param>
<pre>
<progress>
<q>
<rp>
<rt>
<ruby>
<s>
<samp>
<script>
<section>
<select>
<small>
<source>
<span>
<strike> DEPRECATED
<strong>
<style>
<sub>
<summary>
<sup>
<table>
<tbody>
<td>
<tfoot>
<th>
<thead>
<time>
<title>
<tr>
<track>
<tt> DEPRECATED
<u>
<ul>
<var>
<video>
<wbr>