This property controls the size of text for a section. Objects within
a section (such as Applets, Images and Horizontal Rules) are not
affected by this property. The actual size of the font can be different
than the value specified for 'font-size' due to interactions with the
'font-size-adjust' property. Child elements inherit the calculated value
of the 'font-size' property.
Allowed Values
inherit
CSS2
Type: Explicit
Description:
Explicitly sets the value of this property to that of the parent.
xx-small | x-small |
small | medium |
large | x-large |
xx-large
CSS1 | CSS2
| IE3B1 | N4B3
| O3.5
Type: Explicit
Description:
These values are computed against a table of available font sizes compiled by
the browser. Medium is the default value for the 'font-size' property and
should be equivalent to the current browser default size. A scaling factor
of 1.2 is suggested in CSS2 for adjacent keyword values.
smaller | larger
CSS1 | CSS2
| IE4B1 | N4B3
| O3.5
Type: Calculated
Description:
This size change value is relative to the font size of the parent element
but is limited in range to that allowed by the system.
[length]
CSS1 | CSS2
| IE3B1 | N4B2
| O3.5
Type: Explicit
Description:
Refers to either the length in relation to the current element or an
absolute measurement. Negative values are not allowed.
[percentage]
CSS1 | CSS2
| IE3B1 | N4B3
| O3.5
Type: Explicit
Description:
Refers to a percentage of the font size of the parent element.
Example
Ext/Doc: h5.xsmall
{ font-size: x-small }
In-Line: <h5STYLE="font-size:
x-small">text</h5>
Notes
In CSS1 the suggested font scaling factor between explicit keyword
indices was 1.5. Practice proved this value to be too large, so the
recommendation was changed to a scaling factor of 1.2.
For this property in CSS2, the 'em' and 'ex' measurements refer to the
font size of the parent element.
Browser Peculiarities
Internet Explorer
3.0:
- Keyword values of "smaller"/"larger" both treated as "small"
- Negative values for length measurements are converted to
positive values, not ignored as they should be.
- Percentages are based on the default font-size for an element,
not the font-size of the parent.
4.0+:
- Default font-size is now "small", not "medium".
Netscape
4.0:
- Default font-size is "small", not "medium" as expected.
- Using the keyword "smaller" from the default font size ("small")
sets the size to "xx-small", not "x-small" as expected.
- Using the keyword "larger" from the default font size ("small")
sets the size to an almost-"large" size, but not exactly the same.
- Percentages under 100% quickly make the text content unreadable
(as well as changing the color of the text.)
- 100% is not the same as the default font size.
- Percentages are based on the default font-size, not the
font-size of the parent.
Opera
3.5:
- Using the keyword "smaller" from the default font size ("medium")
sets the size to "x-small", not "small" as expected.