Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Font Properties

Font size: changes the size of the font.

Ex: h1 {
Font-size: 20px;
}

Static sizes:
Px = pixel
Pt = point
Points are used for apps like Microsoft Word.

1px = 1/96inch = 0.26mm


1pt = 1/72inch = 0.35mm

Relative sizes:

1em = size of the parent

Ex:
<body font-size=20px>
<h1 font-size=1em> h1 size is going to be 20px

If we set the h1 to 2em it is going to be 2x20px=40px

1rem = size of the root

Ex:
<html font-size=40px>
<body font-size=20px>
<h1 font-size=1rem> h1 size is going to be 40px
Font weight: changes the weight of the used font.
We can use:
 Keywords: normal/bold
 Relative to the parent: lighter/bolder (for lighter it -100 and
bolder +100)
 Number: 100-900

Font family: changes the font family used.


Ex:
h1 {
font-family: Helvetica, sans-serif;
}
h2 {
font-family: “Times New Roman”, serif;
}

When we have a multi word font family we use “”.

You might also like