Use the CSS font-size property to determine the size of your text.

.container {
    font-size: 33px;
}

This property takes several types of values:

  • Keywords (absolute-size and relative-size keywords),
  • Length (such as pixels (px) and em units), and
  • Percentages.
.container {
    font-size: xx-large;
}

The question is: which type of value should you choose and why?

That’s the question this article tackles. It’ll show you how to use the font-size property and the differences between its many values. So the next time you need to change the font size of your text, you’ll know which value to reach for.

Keyword Values

There are two types of keyword values you can use with font size: absolute-size and relative-size keywords. Let’s start with absolute.

Absolute-Size Keywords

The code below uses the absolute-size keyword **small** to size the HTML text.

.childElement {
    font-size: small;
}

There are more absolute-size keyword options to choose from:

  • xx-small
  • x-small
  • small
  • medium
  • large
  • x-large
  • xx-large
  • xxx-large

The value of an absolute-size keyword is determined by the browser’s default font size. Typically, that size is medium.

#css #html #web-development #programming #developer

CSS Font Size Tutorial – How to Change Text Size in HTML
3.50 GEEK