Main content
Unlisted resources area
Course: Unlisted resources area > Unit 2
Lesson 2: Webpage documentation- HTML: The h1 to h6 tags
- HTML: The p tag
- HTML: The br tag
- HTML: The ul, ol, and li tags
- HTML: The strong and em tags
- HTML: The a tag
- HTML: The image tag
- HTML: The table tags
- CSS: The element selector
- CSS: The descendant selector
- CSS: The class selector
- CSS: The id selector
- CSS: The color property
- CSS: The background-color property
- CSS: The font-family property
- CSS: The font-size property
© 2023 Khan AcademyTerms of usePrivacy PolicyCookie Notice
CSS: The font-size property
The
font-size
property specifies the size of the text. It can be specified as a fixed size in various units, a percentage, or as a predefined keyword.The
px
unit lets you size font in terms of pixels, which is the unit also used to size images and other elements. The default font-size
for body text is typically 12px
. There are various keywords that can be used for less precise sizing: xx-small
, x-small
, small
, medium
, large
, x-large
, xx-large
.There are several options for relative sizing: percentage (
120%
) and em
(1.2em
) that will size the font relative to the body size. There are also two relative keywords, that will size the font relative to its inherited size: smaller
, larger
.