Set font-size to smaller in HTML and CSS

Description

The following code shows how to set font-size to smaller.

Example


<html>
<head>
<style type='text/css'>
div {<!--from  w w  w .  j  ava  2 s  . c o m-->
border: 1px solid gray;
padding: 5px;
margin-left: 20px;
}
</style>
</head>
<body>
<div style='font-size: smaller; background: rgb(180, 180, 180);'>
font-size: smaller; <span style='font-size: 28px;'>font-size: 28px;</span>
</div>

</body>
</html>

Click to view the demo

The code above generates the following result.

Set font-size to smaller in HTML and CSS