<font> Tag in HTML
The <font> tag in HTML was used to define the font, size, and color of text. However, it is considered obsolete in HTML5. Styling should now be done using CSS instead of the <font>
tag.
Key Points on <font> Tag:
- The
<font>
tag was used to control the appearance of text by defining its font, size, and color. - In HTML5, the
<font>
tag is no longer supported, and it is recommended to use CSS for styling text. - Although obsolete, some older web pages may still use the
<font>
tag for compatibility.
Syntax of <font> Tag:
Syntax Example
<font color="color" size="size" face="font-family">Text</font>
Example of <font> Tag in HTML:
This example demonstrates the use of the <font>
tag to change text color, font, and size.
Code Example
<font color="red" size="5" face="Arial">Welcome To Shorat Programming.</font>
Output
Welcome To Shorat Programming.
Attributes of <font> Tag:
- color: Specifies the color of the text (e.g.,
red
,#FF5733
). - size: Specifies the size of the text. The value can be a number (1-7), where 1 is the smallest and 7 is the largest.
- face: Specifies the font family to be used for the text (e.g.,
Arial
,Times New Roman
).
Although the <font>
tag is deprecated, it may still be found in older web content. Modern web standards prefer using CSS for styling, offering greater flexibility and separation of structure and design.