Quackit Logo

Got a MySpace Page?

Get "www.yourname.com" for your MySpace page. Learn how >>.

HTML Font Size Code

Print Version

In HTML, font size is specified using CSS (Cascading Style Sheets). Font size can be specified in different ways. You can specify font size in any of the following ways:

You can use the following HTML code to specify font size within your HTML documents. All you need to do is select your preferred option, then change the values to suit.

TIP: Try the HTML text generator.

Absolute Size

Copy and paste this code:

<p style="font-size:xx-small;">Absolute size - xx-small</p>
<p style="font-size:x-small;">Absolute size - x-small</p>
<p style="font-size:small;">Absolute size - small</p>
<p style="font-size:medium;">Absolute size - medium</p>
<p style="font-size:large;">Absolute size - large</p>
<p style="font-size:x-large;">Absolute size - x-large</p>
<p style="font-size:xx-large;">Absolute size - xx-large</p>

This code results in:

Absolute size - xx-small

Absolute size - x-small

Absolute size - small

Absolute size - medium

Absolute size - large

Absolute size - x-large

Absolute size - xx-large

Relative Size

Copy and paste this code:

<p style="font-size:smaller;">
Font size specified using relative values - smaller
</p>
<p style="font-size:larger">
Font size specified using relative values - larger
</p>

This code results in:

Font size specified using relative values - smaller

Font size specified using relative values - larger

Fixed Length

Copy and paste this code:

<p style="font-size:15px;">Font size specified using pixels - 15px</p>

This code results in:

Font size specified using pixels

Percentage Values

Copy and paste this code:

<p style="font-size:70%;">
Smaller font size specified using percentage values - 70%
</p>
<p style="font-size:120%">
Larger font size specified using percentage values - 120%
</p>

This code results in:

Smaller font size specified using percentage values - 70%

Larger font size specified using percentage values - 120%

Enjoy this website?

  1. Link to this page (copy/paste into your own website or blog):
  2. Add this page to your favorite social bookmarks sites:
                     
  3. Add this page to your Favorites

Oh, and thank you for supporting Quackit!