I am Utpal Vishwas from Uttar Pradesh. Have completed my B. Tech. course from MNNIT campus Prayagraj in 2022. I have good knowledge of computer networking.
The CSS property used to specify the font size 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
h1 {
font-size: 24px;
}
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
The CSS property used to specify the font size of an element is font-size. The font-size property can take a variety of values, including:
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