HTML Fonts Tutorials - Fonts


In this tutorial we are going to look at using fonts in your html page for example making them bigger, smaller, bolder, and different colors.  In general changing the font size, color or type is one of the most important things to learn when using html.

So let’s have a look at the basic syntax

<Font> </Font>

So now let’s have a look at some of the attributes html fonts have

HTML Font Size:

We can set the text size of a particular word or group of words (paragraph) by using the size attribute, for example:

<p>
<font size="3">This text is size 3 font</font>
</p>

 

The output in Internet explorer would be

 

html fonts tutorial

 

The range of accepted values for font size is from 1(smallest) to 7(largest).The default size of a font is 3.

 

Another example using font size 5.

<p>
<font size="5">This text is size 5 font</font>
</p>

 

html fonts tutorial

 

HTML Font Color:

In Html we can easily change our text color by setting the attribute color, the attribute color can contain a hex value ‘#999999’ or just the color name ‘blue’, for example

<font color="#990000">Our Text color is hexcolor  = #990000</font>
<br />
<font color="blue">Our Text color is now set to RED</font>

 

html fonts tutorial

 

HTML Font Face:

The face attribute specifies the font or font family to be used in your paragraph / document.  The basic syntax is as follows

<font face="font-family">

Examples of different font face effects

html fonts tutorial

Example:

<font face="Arial Black">font type is impact</font>

 

Output in your browser:

html fonts tutorial

 

Tips and Notes
Tip: Use CSS to define the font face, font size, and font color of text.


 

C++ Functions Tutorial