font: ***;

Browser
  • IE
  • Cr
  • Sf
  • Fx
  • O

The font property is a shorthand property for setting all font properties.


p {
font: italic normal bold 80%/150% "Century Gothic";
}

Property Value Explanation
font each value sets style, small-caps, weight, size, line height, and font family

font: italic normal bold 80%/150% "Century Gothic";

The values other than the font-size and font-family properties can be omitted.

font: 80% "Century Gothic";

The values of the font-size and line-height properties are separated by a slash(/).

80%/150% (The font-size value/The line-height value)

Example


<html>
<head>
<title>TAG index</title>

<style type="text/css">

#example1 { font: italic normal bold 200%/150% "Century Gothic",sans-serif; }
#example2 { font: 120% serif; }

</style>

</head>
<body>

<p id="example1">Sets all font properties</p>
<p id="example2">Sets all font properties</p>

</body>
</html>

Output

Sets all font properties

Sets all font properties