font-size
Anonymous contributor
Anonymous contributor3071 total contributions
Anonymous contributor
Published Jun 29, 2021Updated Sep 3, 2021
Contribute to Docs
The font-size
property sets text size. Font size values can be in many different units like absolute lengths and relative lengths.
Syntax
font-size: <font-size-value>;
Absolute lengths can be the following:
px
in
mm
cm
pt
pc
Relative lengths can be the following:
%
em
rem
ch
ex
vh
vw
vmax
vmin
Example 1
Set the p
tag to 16px
:
p {font-size: 16px;}
Example 2
Set the p
tag to 2em
:
html {font-size: 16px;}p {font-size: 2em;}
All contributors
- Anonymous contributorAnonymous contributor3071 total contributions
- EugeneGoh_51 total contributions
- christian.dinh2476 total contributions
- Anonymous contributor
- EugeneGoh_
- christian.dinh
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.