CSS Attributes Index Font Attributes
Sets or retrieves the size of the font used for text in the object.
CSS |
{ font-size: absolute-size | relative-size | length | percentage } |
Script |
object.style.fontSize = sSize ] |
absolute-size |
Set of keywords that indicate predefined font sizes. Possible keywords include [ xx-small | x-small | small | medium | large | x-large | xx-large ] . Named font sizes scale according to the user's font setting preferences. |
relative-size |
Set of keywords that are interpreted as relative to the font size of the parent object. Possible values include [ larger | smaller ] . |
length |
Value expressed as an absolute measure ( cm, mm, in, pt, pc, or px ) or as a relative measure ( em or ex ). |
percentage |
Percentage value of the parent object’s font size. In Microsoft® Internet Explorer® 3.0, the value is calculated as a percent of the default font size. |
The property is read/write with a default value of medium; the cascading stylesheet ( CSS ) attribute is inherited.
Negative values are not allowed. Font sizes using the proportional "em" measure are computed based on the font size of the parent object.
Possible length values specified in a relative measurement, using the height of the element’s font ( em ) or the height of the letter "x" ( ex ), are supported as of Microsoft® Internet Explorer® 4.0 or later.
The following example demonstrates the effects of applying user-supplied values with any of the various length units possible for the CSS font-size attribute.
Show me
The following example demonstrates the effects of applying any of the predefined lenght units possible for the CSS font-size attribute.
Show me
font, @font-face Rule, font-family, font-style, font-variant, font-weight, CSS Length Units