CSS Property Value How to - font-variant: small-caps;








Question

We would like to know how to font-variant: small-caps;.

Answer


<!DOCTYPE html>
<html lang="en">
<head>
<title>Example of CSS :first-line Pseudo-element</title>
<style type="text/css">
p:first-line {<!--   w  w w  .  j a va  2  s  . c o  m-->
  color: #ff0000;
  font-variant: small-caps;
}
</style>
</head>
<body>
  <p>The first line of this paragraph is styled differently form the
    rest of line. The first line of this paragraph is styled differently
    form the rest of line. The first line of this paragraph is styled
    differently form the rest of line. The first line of this paragraph is
    styled differently form the rest of line. The first line of this
    paragraph is styled differently form the rest of line.</p>
</body>
</html>

The code above is rendered as follows: