Skip to main content

CSS Font Style

The font-style property sets the style of the text. It can take one of these values:

  • normal — the text is shown normally.
  • italic — the text is shown in italics.
  • oblique — the text is leaning (very similar to italic).

Example

Three paragraphs show normal, italic, and oblique text.

Prompt
An HTML page that shows the font-style property. In an internal <style> block, make three paragraph classes: normal, italic, and oblique. Add a paragraph of each class.
Output: complete HTML page

CSS Font Weight

The font-weight property sets how thick or thin the characters are. It can take one of these values:

  • normal — the default.
  • bold — thick characters.
  • bolder — thicker characters.
  • lighter — lighter characters.
  • 100–900 — from thin to thick. 400 is the same as normal, and 700 is the same as bold.

Example

Four paragraphs show normal, lighter, bold, and weight 900 text.

Prompt
An HTML page that shows the font-weight property. In an internal <style> block, make four paragraph classes: normal, lighter, bold, and 900. Add a paragraph of each class.
Output: complete HTML page

CSS Font Variant

The font-variant property sets whether the text is shown in a small-caps font.

In a small-caps font, all lowercase letters become uppercase, but the converted letters are smaller than the original uppercase letters.

Example

One paragraph is normal and the other uses small-caps.

Prompt
An HTML page that shows the font-variant property. In an internal <style> block, make two paragraph classes: normal and small-caps. Add a paragraph of each class with mixed-case text so the small-caps effect is visible.
Output: complete HTML page