Greetings, My name is Richard Leonard. Better know as Renegade Rich 🍻 Contact Rich
      I own many websites and domain names. All are for sale. If you have any questions or inquiries you can use the general contact forum to contact me about anything.👌


Font Tag

The HTML <font> tag was used in HTML 4 to specify the font face, font size, and color of text1. However, this tag is not supported in HTML5123 and should be replaced by CSS styles13.

The syntax of the <font> tag is:

<font attribute="value"> Content </font>

The <font> tag has three attributes:

  • size: This attribute is used to adjust the size of the text in the HTML document. The range of size is from 1 to 7 and the default size is 32.

  • color: This attribute is used to set the color of the text. The value can be a color name, a hexadecimal value, or an RGB value23.

  • face: This attribute is used to set the typeface or font family of the text. The value should be a font name that is installed on the system23.

Here is an example of using the <font> tag with different attributes:

<!DOCTYPE html>
<html>
<body>
<font size="5" color="blue" face="verdana">This is some text.</font>
</body>
</html>

The output would look like this:

This is some text.

However, as mentioned earlier, the <font> tag is deprecated and should not be used in modern web pages. Instead, you can use CSS styles to achieve the same effect. For example, you can use the following CSS properties to style your text13:

  • color: This property sets the color of the text.

  • font-size: This property sets the size of the text.

  • font-family: This property sets the typeface or font family of the text.

Here is an example of using CSS styles to style your text:

<!DOCTYPE html>
<html>
<head>
<style>
p {
color: blue;
font-size: 20px;

The output would look like this:

This is some text.

You can learn more about CSS Text and CSS Fonts in our CSS tutorial1.

Article Details

Article ID:
5
Category:
Rating :

Related articles