- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML Tag
The <font> tag in HTML is used to set font color, font family and font size. Following is the attributes −
- color: Set the color of the font.
- face: Set the font face i.e. family.
- size: Set the font size
Note − The <font> tag isn’t supported in HTML5.
Let us now see an example to implement the <font> tag in HTML −
Example
<!DOCTYPE html> <html> <body> <h2>Playing with Fonts</h2> <p>Displaying different fonts below:</p> <p><font face="arial" size="20" color="yellow">Demo Text!</font></p> <p><font size="10" color="gray">Demo Text!</font></p> <p><font size="15" face="verdana" color="magento">Demo Text!</font></p> <p><font size="8" face="calibri" color="magento">Demo Text!</font></p> </body> </html>
Output
In the above example, we have set the font using the font tag attributes −
<font size="8" face="calibri" color="magento"> Demo Text! </font>
Above, we have set the font size with −
font size="8"
We have set the font face with face attribute −
font face="calibri"
The font color with color attribute −
font color="magento"
Advertisements