letter-spacing Attribute | letterSpacing Property

MS Office DHTML, HTML & CSS

letter-spacing Attribute | letterSpacing Property


Sets or retrieves the amount of additional space between letters in the object.

Syntax

HTML{ letter-spacing: sSpacing }
Scriptingobject.style.letterSpacing [ = sSpacing ]

Possible Values

sSpacing String that specifies one of the following values:
normalDefault spacing.
lengthFloating-point number, followed by an absolute units designator (cm, mm, in, pt, pc, or px) or a relative units designator (em or ex). For more information about the supported length units, see CSS Length Units.

The property is read/write with a default value of normal; the cascading style sheets (CSS) attribute is inherited.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see dynamic propertiesInternet Link.

Remarks

When specified as a positive length value, the letter-spacing attribute adds the specified value to the default spacing between characters within an element. A negative length value decreases the space between characters. Letter spacing can be influenced by justification.

Example

The following examples use the letter-spacing attribute and the letterSpacing property to change the space between letters.

This example uses BLOCKQUOTE as a selector to change the spacing to -0.2 millimeters for all BLOCKQUOTE objects on the page.

Sample Code

<STYLE>
    BLOCKQUOTE { letter-spacing:-0.2mm }
</STYLE>

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

This example uses inline scripting to set the spacing to 1 millimeter when an onmouseover event occurs.

<DIV STYLE="font-size:14" onmouseover="this.style.letterSpacing='1mm'">
:
</DIV>

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, currentStyle, custom, DD, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FORM, Hn, HTML, I, 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, ISINDEX, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, runtimeStyle, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, style, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP

Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.