Fonts (Font Style)

The font-style property is mostly used to specify italic text.

Font-Style Property 

The font style property has 3 values.

normal – The text is shown normally.
italic – The text is shown in italics.
oblique – The text is “leaning” (oblique is very similar to italic, but less supported)

Given below is an example of Font Style Property

See the Pen CSS-Font-Style by Ankit (@AnkitPathshalaCoding) on CodePen.

Font Weight

The font-weight property specifies the weight of a font:

Given below is an example

See the Pen CSS-font-weight by Ankit (@AnkitPathshalaCoding) on CodePen.

Font Variant

The font-variant property specifies whether or not a text should be displayed in a small-caps font.

In a small-caps font, all lowercase letters are converted to uppercase letters.

However, the converted uppercase letters appears in a smaller font size than the original uppercase letters in the text.

See the Pen CSS-Font-variant by Ankit (@AnkitPathshalaCoding) on CodePen.

Font Size

The font-size property sets the size of the text.
Being able to manage the text size is important in web design. However, you should not use font size adjustments to make paragraphs look like headings, or headings look like paragraphs.

Always use the proper HTML tags, like
for headings and


for paragraphs.

The font-size value can be an absolute, or relative size.

Absolute size:
1. Sets the text to a specified size.
2. Does not allow a user to change the text size in all browsers (bad for accessibility reasons).
3. Absolute size is useful when the physical size of the output is known.

Relative size:
1. Sets the size relative to surrounding elements.
2. Allows a user to change the text size in browsers.

If you do not specify a font size, the default size for normal text, like paragraphs, is 16px (16px=1em).

Example on Font-size

See the Pen CSS-font-size by Ankit (@AnkitPathshalaCoding) on CodePen.

Exercise 6.1

This webpage shows some famous declarations and sayings, add a CSS rule to make all quotes have an italic font style.