font-size

Sets a value that indicates the font size used for text in the object.

Syntax

{ font-size: sSize }

Possible values

sSize

Variant that specifies or receives one of the following values:

absolute-size

Set of keywords that indicate predefined font sizes. Named font sizes scale according to the user's font setting preferences. Possible values include the following: xx-small, x-small, small, medium, large, x-large, xx-large.

length

Floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px).

For more information about the supported length units, see the Length units reference.

percentage

Integer, followed by a percent sign (%). The value is a percentage of the font size of the parent object.

relative-size

Set of keywords that are interpreted as relative to the font size of the parent object. Possible values include the following: larger, smaller.

This property has a default value of medium. It is inherited.

Remarks

Negative values are not allowed. Font sizes using the proportional em measure are based on the font size of the parent object.

Examples

The following example uses the font-size property to change font characteristics. This example sets the font size on several paragraphs using different size values:

<style>
   body{font-size: 10pt}
   .p1 {font-size: 14pt}
   .p2 {font-size: 75%}
   .p3 {font-size: xx-large}
   .p4 {font-size: larger}
</style>

Standards information

This property is defined in Cascading Style Sheets (CSS), Level 1 (CSS1) Ee371175.xtlink_newWindow(en-us,Expression.40).png.

Applies to

a, abbr, acronym, b, bdo, big, blockquote, body, button, caption, center, cite, code, custom, dd, defaults, del, dfn, div, dl, dt, em, embed, fieldset, font, form, frameset, frame, hn, i, iframe, img, input type=button, input type=checkbox, input type=file, input type=image, input type=password, input type=radio, input type=reset, input type=submit, input type=text, ins, li, object, ol, p, q, s, span, sub, table, td, th, tt, u, ul, var, xmp

See also

Concepts

font

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.