Web Development Tutorials.com

How to specify the font-size with CSS


Click Here for CoffeeCup Website Design Software   GoDaddy.com Hosting & Servers

The below HTML and CSS code example shows you how to specify the font-size with CSS.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>this is the title of the web page</title>

<style type="text/css">

</style>

</head>
<body>

<p>
This is a paragraph with a default font-size.
</p>
<p style="font-size: 150%;">
This is a paragraph with a font-size of 150%.
</p>
<p style="font-size: 13px;">
This is a paragraph with a font-size of 13px.
</p>
<p style="font-size: 17px;">
This is a paragraph with a font-size of 17px.
</p>

</body>
</html>

The above HTML and CSS code makes the paragraphs below.

This is a paragraph with a default font-size.

This is a paragraph with a font-size of 150%.

This is a paragraph with a font-size of 13px.

This is a paragraph with a font-size of 17px.

Use the text editor below to practice setting the font-size of text.