Setting the Font Style

Description

The font-style property selects between normal, italic, and oblique fonts.

There is a distinction between italic and oblique fonts, but the distinction makes little difference to the appearance of text.

Example

The following code uses the font-weight and font-style Properties.


<!DOCTYPE HTML>
<html>
<head>
<style type='text/css'>
body {<!--from  w ww.ja va  2s  .  c  o  m-->
  color: #000000;
  background-color: #ffffff;
  font-family: arial, verdana, sans-serif;
  font-size: 12px;
}

td {
  width: 200px;
}

p.one {
  font-style: normal;
}

p.two {
  font-style: italic;
}

p.three {
  font-style: oblique;
}
</style>

</head>

<body>
  <h1>font-style</h1>

  <p class="one">This is a normal font</p>
  <p class="two">This is an italic font</p>
  <p class="three">This is an oblique font</p>

</body>
</html>

Click to view the demo





















Home »
  HTML CSS »
    CSS »




CSS Introduction
CSS Background
CSS Border
CSS Box Layout
CSS Text
CSS Font
CSS Form
CSS List
CSS Selectors
CSS Others
CSS Table