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