Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

whiteSpace property

Sets or retrieves a value that indicates whether lines are automatically broken inside the object.


Integer value = object.put_whiteSpace( v);Integer value = object.get_whiteSpace(* sWrap);

Property values

Type: BSTR

normal (normal)

Default. Lines of text break automatically. Content wraps to the next line if it exceeds the width of the object.

nowrap (nowrap)

Line breaks are suppressed. Content does not wrap to the next line.

pre (pre)

Line breaks and other whitespace are preserved. This possible value is supported in Internet Explorer 6 and later when the !DOCTYPE declaration specifies standards-compliant mode. When the !DOCTYPE declaration does not specify standards-compliant mode, you can retrieve this value, but it does not affect rendering—it functions like the normal value.

pre-line (pre-line)

Sequences of line breaks are preserved.

pre-wrap (pre-wrap)

Sequences of line breaks are collapsed.

String format

normal | pre | nowrap | pre-wrap | pre-line

CSS information

Applies ToAll elements
Initial Value


Whitespace, such as line breaks, spaces, and tabs, is collapsed by default in HTML documents. You can use the nonbreaking space entity ( ) to add extra spaces to an object when the IHTMLCurrentStyle3::whiteSpace property is set to normal or nowrap. You can add extra line breaks using the br element.

This property affects content you access through the Document Object Model (DOM) the same way it affects the way Windows Internet Explorer displays the content.

Still in Internet Explorer 6, this property applies to the currentStyle element. The pre value of this property is now supported.

Windows Internet Explorer 8. The pre-line and pre-wrap values are used to control sequences of whitespace. A value of pre-line instructs Windows Internet Explorer to combine multiple line breaks into a single line, whereas pre-wrap wraps each newline onto a separate line. Inside a pre block, lines breaks occur at newlines in the source, at occurrences of "\A" in generated content (::before and ::after), and as necessary to fill line boxes.


Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]







See also

Other Resources
CSS Enhancements in Internet Explorer 6



Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.