Set font-size to 18px in HTML and CSS

Description

The following code shows how to set font-size to 18px.

Example


<html>
<html>
<head>
<style type="text/css">
h2 {<!--from w  w w. j ava 2 s .c o m-->
font-family: Georgia, Times, serif;
font-size: 18px;
}

</style>
</head>
<body>
<h1>this is a test. </h1>
<h2>this is a test. </h2>
<p>this is a test. <strong>this is a test. </strong> this is a test. </p>
<p>this is a test. </p>
</body>
</html>

Click to view the demo

The code above generates the following result.

Set font-size to 18px in HTML and CSS