The CSS font-size property controls how large text appears inside an element. Set it to a value such as 24px to replace the browser’s default size. section 4.4
Use font-size to:
- Set deliberate sizes for headings, body text, captions, sidebars, navigation, and other page elements instead of relying on defaults. section 4.4
- Choose relative units such as em when text should respond to the browser’s or user’s default font size. section 14.9
- Remember that font-size can inherit: child and descendant elements may receive styling from a parent. section 14.9
Make a div’s text larger
div { font-size: 24px; } This renders text inside the div at 24 pixels, while a paragraph using the browser default remains 16 pixels in modern browsers. section 4.4
div { #1
font-size: 24px; #1
} #1
Inspect the compact CSS listing showing the property, value, and px unit together. section 4.4








