---
title: "What is the CSS property used to specify the font size of an element?"  
description: "What is the CSS property used to specify the font size of an element?"  
author: "Utpal Vishwas"  
published: 2023-06-06  
updated: 2023-06-07  
canonical: https://www.mindstick.com/forum/158654/what-is-the-css-property-used-to-specify-the-font-size-of-an-element  
category: "css-css3"  
tags: ["css", "css shape"]  
reading_time: 2 minutes  

---

# What is the CSS property used to specify the font size of an element?

What is the [CSS](https://www.mindstick.com/forum/514/background-gradient-ie7-css-problem) [property](https://www.mindstick.com/blog/205/property-notification-in-c-sharp) used to specify the [font size](https://www.mindstick.com/forum/33596/increase-font-size-in-uiwebview-in-ios) of an element?

## Replies

### Reply by Aryan Kumar

The CSS property used to specify the font [size](https://www.mindstick.com/forum/159799/how-can-you-manage-the-size-of-mdf-and-ldf-files) of an element is font-size. The font-size property can take a variety of values, including:

- **Absolute values:** These values specify the font size in pixels, centimeters, or other absolute units. For example, font-size: 16px; will set the font size to 16 pixels.
- **Relative values:** These values specify the font size relative to the font size of the parent element. For example, font-size: 1.5em; will set the font size to 1.5 times the font size of the parent element.
- **Percentage values:** These values specify the font size as a percentage of the font size of the root element. For example, font-size: 50%; will set the font size to 50% of the font size of the root element.

The font-size property can also be used to specify the font size of multiple elements at once. To do this, you can use the font-size property on a class or id selector. For example, the following CSS code will set the font size of all h1 elements to 24 pixels:

Code snippet

```plaintext
h1 {
  font-size: 24px;
}
```


---

Original Source: https://www.mindstick.com/forum/158654/what-is-the-css-property-used-to-specify-the-font-size-of-an-element

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
