HTML Font Size
This page provides you with the HTML font-size code that you can use to copy/paste into your own website.
You change the size of the text by using the font-size
property:
The above code results in this:
This text has been set to 20pt using the CSS font-size property.
More About Font Size
You aren't restricted to just using point size (pt) when setting the font size. You can use a number of different values.
For example, you could use pixels or a percentage value.
Here's an example of using a pixel value:
The above code results in this:
This text has been set to 20px using the CSS font-size property.
Here's an example of using a percentage value:
The above code results in this:
This text has been set to 130% using the CSS font-size property.
Possible Values
When setting font size, you can use the following values:
Absolute Size:
- xx-small
- x-small
- small
- medium
- large
- x-large
- xx-large
Relative Size:
- larger
- smaller
Length:
- An absolute font size (independent of the user agent's font table). Negative lengths are illegal.
Percentage:
- An absolute font size relative to the parent element's font size.