

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 to set text font family in HTML?
To change the text font family in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property font-family. HTML5 do not support the <font> tag, so the CSS style is used to add font size.
Just keep in mind, the usage of style attribute overrides any style set globally. It will override any style set in the HTML <style> tag or external style sheet.
Example
You can try to run the following code to change the text font family in an HTML page
<!DOCTYPE html> <html> <head> <title>HTML Font Family</title> </head> <body> <h1>Our Products</h1> <p style="font-family:georgia,garamond,serif;"> This is demo text </p> </body> </html>
- Related Questions & Answers
- How to set the font family for text with JavaScript?
- Set the font family with CSS
- How do we set text font in HTML?
- How to set default font family for entire Android App?
- Font Family in CSS
- How to change text font in HTML?
- How to set font for Text in Tkinter?
- How to set font color in HTML?
- How to set font to text node in JavaFX?
- How to change font Family of textView In Android?
- Usage of font-family property in CSS
- How to set font for text in JTextPane with Java?
- How can I change the font family and font size with jQuery?
- How to set Text alignment in HTML?
- How to set text direction in HTML?
Advertisements