letter-spacing
CSS Attributes Reference

letter-spacing

Description

Specifies additional space between letters.

This attribute will add the appropriate letter spacing after each character. If you do not want the end of a word to be affected by the spacing, you need to place the last character outside the closing element tag. Letter spacing can be influenced by justification . The length value indicates an addition to the default space between characters. Negative values are permitted.

Syntax

{ letter-spacing: normal | length}

Remarks

This attribute is inherited.

Example

In the following example, the word-spacing between each character in BLOCKQUOTE elements would be increased with '1.0em'.

BLOCKQUOTE { letter-spacing: 1.0em }

Applies To

A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, DD, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FORM, H1, H2, H3, H4, H5, H6, HTML, I, INPUT, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, S, SAMP, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP, INPUT type=button, INPUT type=file, INPUT type=reset, INPUT type=submit, INPUT type=text

Scripting Property

letterSpacing


line-height

Description

Specifies how far apart the lines in a paragraph are. Line height measures the distance between the descender of the font to the top of the internal leading of the font.

If there is more than one element on a formatted line, the maximum line height applies. Negative values are not allowed.

Syntax

{ line-height: normal | number | length | percentage}

Remarks

This attribute is inherited.

Example

The three rules in this example are identical. If the value is set to normal, the line height is set to the default line height for the element's font.

DIV { line-height: 1.2%; font-size: 10pt }   /* number */
DIV { line-height: 1.2em; font-size: 10pt } /* length */
DIV { line-height: 120%; font-size: 10pt } /* percentage */

Applies To

A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, DD, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FORM, H1, H2, H3, H4, H5, H6, HTML, I, INPUT, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, S, SAMP, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP, INPUT type=button, INPUT type=file, INPUT type=reset, INPUT type=submit, INPUT type=text

Scripting Property

lineHeight


link

Description

Sets the style of A elements for the default state of the link. This is when the link has not been visited, and is not actively being navigated or has a mouse positioned over it. Setting the hover pseudo-class is often used in conjunction with setting specific styles for the other states of a link: active, visited, and hover. Note the syntax in the example below uses a colon (:) to specify a pseudo-class.

Example

The following example sets unvisited links to red and visited links to blue.

A:link   { color: red }           /* unvisited link */
A:visited  { color: blue }       /* visited links */

Applies To

A

See Also

active, hover, visited


list-style

Description

Sets the three properties—list-style-type, list-style-image, and list-style-position—at the same rule for the style sheet. A URL can be combined with another list-style-type. This property is a shorthand notation.

Syntax

{ list-style: keyword || position || url}

Remarks

This attribute is inherited.

Example

In the following example, the "disc" will be used if the image cannot be found.

UL {list-style: url(http://some_image.gif) disc} 

Applies To

UL, OL, LI, DT, DD

Scripting Property

listStyle


list-style-image

Description

Specifies an image to use as a list-item marker. When the image is available, it will replace the marker set with the list-style-type marker. The initial value for this property is none.

Syntax

{ list-style-image: url | none}

Applies To

DD, DT, LI, OL, UL

This attribute is inherited.

Scripting Property

listStyleImage


list-style-position

Description

Determines how the list-item marker is drawn with regard to the content. This property is applicable only on elements with a display value of list-item.

Syntax

{ list-style-position: inside | outside}

Remarks

This attribute is inherited.

Applies To

DD, DT, LI, OL, UL

Scripting Property

listStylePosition


list-style-type

Description

Specifies a predefined list item marker. Determines the appearance of the list-item marker if list-style-image is none or if the image pointed to by the URL cannot be displayed. The initial value is disc

Syntax

{ list-style-type: disc | circle | square | decimal | lower-roman | upper-roman | lower-alpha | upper-alpha | none}

Remarks

This attribute is inherited.

Applies To

DD, DT, LI, OL, UL

Scripting Property

listStyleType


margin

Description

Sets the margin on all four sides of an object with a single style sheet rule.

This is a composite property. The "{1,4}" means that up to four values can be specified. Specifying one value applies that value to all four sides; specifying two values applies the first value to the top and bottom, and the second value to the left and right. Specifying three values applies the first to the top, the second to the right and left, and the third to the bottom. Negative margins are supported except for top and bottom margins on inline elements. Percentage values refer to the parent element's width.

Syntax

{ margin: [ length | percentage | auto] {1,4}}

Remarks

This attribute is not inherited.

Applies To

BLOCKQUOTE, BODY, CENTER, DD, DIR, DIV, DL, DT, FIELDSET, FORM, H1, H2, H3, H4, H5, H6, HR, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, TABLE, TD, TH, TR, UL, XMP, CAPTION, TEXTAREA, IFRAME, SPAN, IMG, EMBED, OBJECT, INPUT

Scripting Property

margin

See Also

margin-bottom, margin-left, margin-right, margin-top


margin-bottom

Description

Specifies the bottom margin for the element. Negative margins are supported except for top and bottom margins on inline elements.

Syntax

{ margin-bottom: [ length | percentage | auto]}

Remarks

This attribute is not inherited.

Applies To

BLOCKQUOTE, BODY, CENTER, DD, DIR, DIV, DL, DT, FIELDSET, FORM, H1, H2, H3, H4, H5, H6, HR, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, TABLE, TD, TH, TR, UL, XMP, CAPTION, TEXTAREA, IFRAME, SPAN, IMG, EMBED, OBJECT, INPUT

Scripting Property

marginBottom

See Also

margin, margin-left, margin-right, margin-top


margin-left

Description

Specifies the left margin for the element. Negative margins are supported except for top and bottom margins on inline elements.

Syntax

{ margin-left: [ length | percentage | auto]}

Remarks

This attribute is not inherited.

Applies To

BLOCKQUOTE, BODY, CENTER, DD, DIR, DIV, DL, DT, FIELDSET, FORM, H1, H2, H3, H4, H5, H6, HR, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, TABLE, TD, TH, TR, UL, XMP, CAPTION, TEXTAREA, IFRAME, SPAN, IMG, EMBED, OBJECT, INPUT

Scripting Property

marginLeft

See Also

margin, margin-bottom, margin-right, margin-top


margin-right

Description

Specifies the right margin for the element. Negative margins are supported except for top and bottom margins on inline elements.

Syntax

{ margin-right: [ length | percentage | auto]}

Remarks

This attribute is not inherited.

Applies To

BLOCKQUOTE, BODY, CENTER, DD, DIR, DIV, DL, DT, FIELDSET, FORM, H1, H2, H3, H4, H5, H6, HR, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, TABLE, TD, TH, TR, UL, XMP, CAPTION, TEXTAREA, IFRAME, SPAN, IMG, EMBED, OBJECT, INPUT

Scripting Property

marginRight

See Also

margin, margin-bottom, margin-left, margin-top


margin-top

Description

Specifies the top margin for the element. Negative margins are supported except for top and bottom margins on inline elements.

Syntax

{ margin-top: [ length | percentage | auto]}

Remarks

This attribute is not inherited.

Applies To

BLOCKQUOTE, BODY, CAPTION, CENTER, DD, DIR, DIV, DL, DT, EMBED, FIELDSET, FORM, H1, H2, H3, H4, H5, H6, HR, INPUT, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, TABLE, TD, TH, TR, UL, XMP, TEXTAREA, IFRAME, SPAN, IMG, OBJECT

Scripting Property

marginTop

See Also

margin, margin-bottom, margin-left, margin-right


overflow

Description

Determines what to do when the element's content exceeds the height and width of the element.

By default, overflowing content is visible. This means the element does not observe its specified height and width. If the attribute is set to scroll, the content is clipped to the height and width specified on the element, and the overflowing content is accessible through scroll bars. If the attribute is set to hidden, the content of the element is clipped to the height and width of the element, and no scroll bars appear to access the hidden content. Applies to positioned elements.

Syntax

{ overflow: scroll | hidden | visible | auto }

Remarks

This attribute is not inherited.

For the TEXTAREA element, only the hidden value is valid. Setting the overflow to hidden on a TEXTAREA element hides its scrollbars.

Example

The following example illustrates this attribute.

<DIV STYLE="position:relative;height:100;width:100;      
      top:0;left:0;background-color:green;overflow:scroll">
put enough text in here that will take up more than 100 x 100 
pixels worth of space. View this, and you will see that you 
will need to use the scroll bars to see the content that won't 
fit within a 100 x 100 window.
</DIV>

Applies To

DIV, TEXTAREA, SPAN, FIELDSET

Scripting Property

overflow


padding

Description

Specifies the padding-top, padding-bottom, padding-left, and padding-right in one style sheet rule.

This is a composite property. The "{1,4}" means that up to four values can be specified. Padding describes how much space to insert between the element and its margin, or if there is a border, between the element and its border. Up to four values can be specified. The order is top, right, bottom, left. If there is only one value, it applies to all sides; if there are two or three, the missing values are taken from the opposite side. Negative values are not allowed. This property is supported on block and replaced elements only.

Syntax

{ padding: [ length | percentage ] {1,4}}

Remarks

This attribute is not inherited.

Applies To

TABLE, TD, TR, CAPTION, TEXTAREA, IFRAME, BODY, MARQUEE, DIV

Scripting Property

padding

See Also

padding-top, padding-bottom, padding-left, padding-right


padding-bottom

Description

Sets the bottom padding of an element. Padding values cannot be negative.

Supported on block and replaced elements only.

Syntax

{ padding-bottom: length | percentage}

Remarks

This attribute is not inherited.

Applies To

TABLE, TD, TR, CAPTION, TEXTAREA, IFRAME, BODY, MARQUEE, DIV

Scripting Property

paddingBottom

See Also

padding-top, padding-left, padding-right, padding


padding-left

Description

Sets the left padding of an element. Padding values cannot be negative.

Supported on block and replaced elements only.

Syntax

{ padding-left: length | percentage}

Remarks

This attribute is not inherited.

Applies To

TABLE, TD, TR, CAPTION, TEXTAREA, IFRAME, BODY, MARQUEE, DIV

Scripting Property

paddingLeft

See Also

padding-top, padding-bottom, padding-right, padding


padding-right

Description

Sets the right padding of an element. Padding values cannot be negative.

Supported on block and replaced elements only.

Syntax

{ padding-right: length | percentage}

Remarks

This attribute is not inherited.

Applies To

TABLE, TD, TR, CAPTION, TEXTAREA, IFRAME, BODY, MARQUEE, DIV

Scripting Property

paddingRight

See Also

padding-top, padding-left, padding-bottom, padding


padding-top

Description

Sets the top padding of an element. Padding values cannot be negative.

Supported on block and replaced elements only.

Syntax

{ padding-top: length | percentage}

Remarks

This attribute is not inherited.

Applies To

TABLE, TD, TR, CAPTION, TEXTAREA, IFRAME, BODY, MARQUEE, DIV

Scripting Property

paddingTop

See Also

padding-bottom, padding-left, padding-right, padding


page-break-after

Description

Indicates when to set a page break and on what page (left or right) the subsequent content should resume.

The values are defined as follows:

auto
Do a page break after the element only if necessary.
always
Always do a page break after the element.
left
Do one or two page breaks after the element until a blank left page is reached.
right
Do one or two page breaks after the element until a blank right page is reached.

If there are conflicts between this property and the page-break-before value on the previous element (as formatted on the canvas), the value that results in the largest number of page breaks will be used.

Syntax

{ page-break-after: auto | always | left | right}

Remarks

This attribute is not inherited.

Example

In the following example, a hard page break is inserted in the document with the BR tag.

<STYLE>
    BR.page { page-break-after: always }
</STYLE>
  ...
  <BR CLASS=page>
  ...

Applies To

A, ADDRESS, APPLET, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, DD, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FORM, FRAME, FRAMESET, H1, H2, H3, H4, H5, H6, HR, HTML, I, IFRAME, IMG, INPUT, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TEXTAREA, TT, U, UL, VAR, XMP, INPUT type=button, INPUT type=file, INPUT type=reset, INPUT type=submit, INPUT type=text, INPUT type=checkbox, INPUT type=radio, INPUT type=image

Scripting Property

pageBreakAfter

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.