You are here: Reference > HTML > attributes > size (basefont, font)

size attribute (basefont, font)

Browser support:
Specifies the size of the font.
This attribute is deprecated. Use the font style property or other style properties to manipulate the font types in the entire document.
JavaScript page for this attribute: size. You can find other example(s) there.

Possible values:

String that sets the size of the font.
One of the following values:
Integer (between 1 and 7) that sets the absolute size of the font.
Integer with (+/-) designator sets the font size relative to the baseFont element.
Default: 3.

Example HTML code 1:

This example illustrates the use of the size attribute:
<basefont size="5" />basefont size=5
<font size="-3">size=-3</font>
<font size="+2">size=+2</font>

<font size="2">size=2</font>
<font size="5">size=5</font>
<font size="7">size=7</font>
Did you find this example helpful? yes no

Example HTML code 2:

<body style="font-size:13px;">
    font size 13px
    <span style="font-size:70%;">font-size:70%</span>
    <span style="font-size:80%;">font-size:80%</span>
    <span style="font-size:120%;">font-size:120%</span>
    <span style="font-size:160%;">font-size:160%</span>
    <span style="font-size:340%;">font-size:340%</span>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content