HTML Fonts

Fonts in HTML

HTML Fonts Size

HTML Fonts are important for any website. You can change the font size of the text using CSS property (font-size: values here). Set font size in px, % or em.

Example

<h3 style="font-size:300%;">Size of the first text</h3>

<h3 style="font-size:2em;">Size of the second text.</h3>

<h3 style="font-size:25px;">Size of the second text.</h3>

Change Font Color in HTML

Use CSS, (color: color name here) color property to give color to the text.

Example

<h3 style="color:Navy;">Text color one</h3>

<h3  style="color:Green;">Text colors two.</h3>

<h3 style="color:crimson;" > Try to give attractive color to your text</h3>

Example Program of font family in HTML

Use CSS, (font-family: font name here) Property to give different font face to your text. 

Example

<p style="font-family:Helvetica;">This is font one</p>

<p style="font-family:Castellar;">This is font two</p>

<p style="font-family:Trebuchet MS;">We can find different types of font family in,HTML , use any of them in style property</p>

Interview Questions & Answer

Font property increases the content readability in HTML. It has three attribute called Font size, color, family.

  1. Font Size— HTML Fonts are important for any website. You can change the font size of the text using CSS property (font-size: values here). Set font size in px, % or em.
  2. Font Color — Use CSS, (color: color name here) color property to give color to the text.
  3. Font family — Use CSS, (font-family: font name here) Property to give different font face to your text.

To create multicolored text we use the (color: color name here) color property. We can use this tag combination as many times as needed.
For example,

<p> style="color:Navy;"></p>
<p> style="color:Green;"></p>
<p> style="color:crimson;" ></p>

We can change the font size by font-size HTML property.
Syntax: (font-size: values here)
Example,

<h3 style="font-size:25px;">Size of the text is 25px.</h3>

Tutorials for all brains!