- Trending Categories
- 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
How do we set text font in HTML?
The <font> tag was used to set the font in HTML, but it is now deprecated. Use CSS for the same purpose.
Example
You can try to run the following code to change the font of text in HTML −
<!DOCTYPE html> <html> <body> <h2>Tutorialspoint</h2> <p>Learning videos</p> <p style = "font-family:'Courier New'">Learning content</p> </body> </html>
Advertisements