Compare percentage font size in HTML and CSS

Description

The following code shows how to compare percentage font size.

Example


<html>
<head>
<style type='text/css'>
p {font-family:arial; font-size:12pt;}
p.fifty {font-size:50%;}
p.hundred {font-size:100%;}
p.hundredandfifty {font-size:150%;}
</style><!--  w  w w. j  a va  2 s .c o  m-->
</head>
<body>
<h1>Percentages (relative to 12pt)</h1>
<p class="fifty">This percentage is 50%</p>
<p class="hundred">This percentage is 100%</p>
<p class="hundredandfifty">This percentage is 150%</p>
</body>
</html>

Click to view the demo

The code above generates the following result.

Compare percentage font size in HTML and CSS