Which CSS property controls the text size of an element?

Prepare for the CodeHS Advanced HTML and CSS Test. Leverage comprehensive questions with detailed explanations and hints. Ace your exam with tailored practice!

The property that controls the text size of an element in CSS is the font-size property. This property allows developers to specify the size of the font that will be applied to the text within an element. By adjusting the font-size, you can increase or decrease the size of the text to enhance readability or achieve a desired visual effect within your layout.

The font-size property accepts various units, including pixels (px), ems, rems, percentages, and others, giving flexibility in how the text size is rendered in relation to other elements or the viewport.

Other options do not relate to adjusting text size appropriately. For instance, text-width is not a recognized CSS property and does not affect text styling, while text-style is also not a valid property for controlling text appearance. Finally, size is too generic and does not specifically pertain to fonts; it could refer to dimensions in other contexts, such as sizing an element but not its text specifically.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy