font-size

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

{ font-size: sSize }

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.

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

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>

A, ADDRESS, APPLET, B, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, CUSTOM, DD, DEFAULTS, DFN, DIV, DL, DT, EM, FIELDSET, FORM, HN, HTML, I, INPUT TYPE=BUTTON, INPUT TYPE=FILE, INPUT TYPE=IMAGE, INPUT TYPE=PASSWORD, INPUT TYPE=RESET, INPUT TYPE=SUBMIT, INPUT TYPE=TEXT, LI, OL, P, S, SELECT, SPAN, SUB, TABLE, TBODY, TD, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP

Concepts

Community Additions

ADD
Show: