Code has been added to clipboard!

HTML Default Font

Reading time 2 min
Published Mar 21, 2019
Updated Jan 21, 2020

HTML Default Font: Main Tips

  • The <basefont> element used to determine the HTML default font, its size and color.
  • HTML 4.01 deprecated the <basefont> element. HTML5 fully removed it.
  • You should use CSS to manipulate the font style.

How basefont Was Used

<basefont> element defined the HTML font size and color. However, the use of this element for font setting is no longer effective as the most popular browsers do not support it.

Example
<head>
  <basefont color="green" size="6" face="verdana">
</head>

Here are the options to control fonts without using the HTML <basefont> element:

  • To set HTML text color, apply the CSS color property.
  • To set HTML font size, use the CSS font-size property.
  • To style fonts by indicating font-related properties, use the CSS font property.
  • To set a list of fonts from the highest priority to lowest, use the CSS font-family property.

The example below shows the proper way of setting font style with CSS properties:

Example
<p>Don’t worry: if Plan A doesn’t work, 
there are 25 more letters in the alphabet. </p>

Deprecated Attributes

color

It defined the default text color in a document. Not supported in HTML5.

Example
<head>
  <basefont color="green">
</head>

face

It set the default text font in a document. Not supported in HTML5.

Example
<head>
  <basefont face="verdana">
</head>

size

It indicated the HTML default font size of text in a document. Not supported in HTML5.

Example
<head>
  <basefont size="6">
</head>

Browser support

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

Mobile browser support

Chrome
-
Firefox
-
Opera
-
Safari
-
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>