HTML font

Updated: 11/13/2018 by Computer Hope

On a web page, an HTML font or web font is the type of text displayed, designated using CSS. In the past, aspects of the font could be changed using attribute and value pairs in the <font> tag. However, in this tag was deprecated in HTML 4.1, and will soon be obsolete. The following sections contain examples of both methods, as well as information on how to get more web fonts.

HTML fonts in CSS

For HTML5 and website design in general, it is recommended that CSS be used to specify the font. The following example specifies the body to use Verdana if available, Arial as a fallback, and the color code #333. With CSS, the font-family and color can by applied directly to any specific HTML element, or added to a certain HTML tag using a class or id.

body {
 font-family: verdana, arial;
 color: #333;

HTML fonts with font tag

Example code

<font face="verdana" color="green" size="+2">Verdana font in a green color</font>

Example result

Verdana font in a green color

Where can I get more web fonts?

One of the easiest methods for getting fonts for your web page is to use Google Fonts, which is a collection of thousands of fonts from Google. These fonts are loaded from their fast and worldwide servers and can improve the look of your website.

  • See the Google Fonts page for a full listing of their available fonts.

CSS, Font, HTML tag, Internet terms, Web, Web design terms