The font-size property specifies the size of the font.


font-size: <absolute-size> | <relative-size> | <length> | <percentage> | inherit
Initial: medium
Applies To: all elements
Inherited: yes
Percentages: refer to parent element's font size
Media: visual


font-size: value
Value Description
absolute-size Index to a table of font sizes: xx-small | x-small | small | medium | large | x-large | xx-large
length Horizontal or vertical measurements: em | ex | px | in | cm | mm | pt | pc
percentage Value relative to the inital value
relative-size Relative to the table of font sizes and the font size of the parent element: smaller | larger


[window.]document.getElementById("element-id").style.fontSize = "font-size";

Example | absolute-size

Example | length

Example | percentage

Example | relative-size

Example | DOM


W3C Cascading Style Sheets, level 1

W3C Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification