Set font-style to italic in HTML and CSS

Description

The following code shows how to set font-style to italic.

Example


<html>
<html>
<head>
<style type="text/css">
h2 {<!--  w w  w .jav a 2s  . co m-->
font-family: Georgia, Times, serif;
font-size: 20px;
font-style: italic;
}

</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-style to italic in HTML and CSS
Home »
  HTML CSS Tutorial »
    Text »
      Font Style
HTML CSS Tutorial Font Style
Compare font style settings:normal,italic,o...
Compare the font-style properties in HTML a...
Set font-style to italic in HTML and CSS
Set font-style to normal in HTML and CSS
Set font-style to oblique in HTML and CSS