The larger and smaller keywords of the font-size property function using the scaling factor of 1.2.
<!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'>
<head>
<title>font-size</title>
<style rel='stylesheet' type='text/css'>
body {
font-size: medium;
}
p#larger {
font-size: larger;
}
p#larger span {
font-size: 20px;
}
p#smaller {
font-size: smaller;
}
p#smaller span {
font-size: 12px;
}
span {
background: mistyrose;
}
</style>
</head>
<body>
<p id='larger'>
This font is 1.2 times the default font, or 20 pixels.<br />
<span>this is a test. </span>
</p>
<p id='smaller'>
This font is 1.2 smaller than the default size, or pixels.<br />
<span>this is a test. </span>
</p>
</body>
</html>
Related examples in the same category