How to change font style in HTML | HTML font style examples

How to change font style in HTML?

There are multiple ways to change font style in HTML, the Basic way is inline CSS style attribute. Another way is Using a style tag in the head tag to the external CSS file.

Example of HTML font style (color, size, bold)

Example code of change the p tag font color , weight and size using inline style attribute in HMLT.

Output:

Example of HTML font style color size bold

Let’s see how to change the font in CSS?

Set font family of a text is set with the font-family property to change the font type in HTML.

Complete example code

Output: With inspect elements

change the font in CSS

Do comment if you have any doubts and suggestions on this tutorial.

Note: The All HTML Examples codes are tested on the Firefox browser and the Chrome browser.

OS: Windows 10

Code: HTML 5 Version


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.