View video tutorial

CSS Font-Size

CSS

This property is used to specify the height and size of the font.

CSS font-size


The font-size property in CSS is used to set the height and size of the font.

Example

#p1 {
  font-size: 40px;
}
#p2 {
  font-size: 30px;
}
#p3 {
  font-size: 12px;
} 
Try it Now »

Click on the "Try it Now" button to see how it works.


Example

body {
  font-size: 100%;
}
#p1 {
  font-size: 2.5em;
}
#p2 {
  font-size: 1.875em;
}
#p3 {
  font-size: 0.875em;
}
Try it Now »

Click on the "Try it Now" button to see how it works.