Font Weight and Italics
The font-weight property sets how thick, or bold, the letters are. Its value is a number from 100 (the thinnest) to 900 (the boldest), usually a multiple of 100. Two weights also have names:
normalis the same as400, the weight of ordinary text,boldis the same as700.
Headings and strong elements are bold only because the browser's built-in styles make them bold. Our rules can change that:
h1 {
font-weight: normal;
}A font only looks different in the weights it really has. On most computers, Arial and Georgia have just two: normal and bold. For any other weight, the browser uses the nearest one the font has, so in Arial, font-weight: 900 looks the same as bold. We will get to fonts with more weights at the end of this lesson.
Italics are set by the font-style property, which you used in the lesson on selectors. The value italic makes text italic, and normal makes it upright again (for example in an em element).
Instructions
- 1
In the rule for
h2, addfont-weight: normal, so that the headings are no longer bold. - 2
In the same rule, add
font-style: italic.