Which property is used to change the font size in CSS?

Prepare for the Web Development 201 Test with flashcards and multiple choice questions including hints and detailed explanations. Boost your exam readiness today!

The property used to change the font size in CSS is indeed font-size. This property allows developers to specify the size of the text within an HTML element, enabling control over how large or small the text appears on the web page.

Using font-size, you can set values in various units, including pixels (px), ems (em), rems (rem), percentages (%), and more. For example, setting font-size: 16px; will make the font size of the specified element 16 pixels, while font-size: 1.5em; would scale the font size relative to its parent element's font size.

Other choices, such as font-style, are used for different typography aspects, such as italicizing text. Text-size and size-font are not recognized CSS properties, so they would not have any effect on font size in a stylesheet. Thus, font-size is the proper property to manipulate the size of text in design and layout.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy