Which of the following property sets the font size of text?a)text-size...
Explanation:font-size Property:The font-size property in CSS is used to set the size of the text in an HTML element. It allows you to specify the size of the font using different units such as pixels, em, rem, percentages, etc.
Example:This is a sample text with font size of 16 pixels.
Setting Font Size:- The font-size property can be applied to various HTML elements such as headings, paragraphs, and spans.
- It can be set using absolute values like pixels or relative values like em or percentages.
- The default font size for most browsers is 16px.
Usage:- To set the font size of text within a specific HTML element, you can use the following CSS syntax:
css
selector {
font-size: value;
}
- Here, the 'selector' can be any HTML element selector like p, h1, span, etc., and the 'value' can be specified in pixels, em, rem, percentages, etc.
Conclusion:The correct property to set the font size of text in CSS is the
font-size property. It allows you to control the size of text within HTML elements to enhance the readability and aesthetics of your web page.