Javascript Reference
Categories: STYLE

javascript STYLE whiteSpace

@March 15, 2008, 1:22 a.m.
whiteSpaceFirefox/Netscape/NN 6 IE 5(Mac)/5.5(Win) Chrome/Safari/DOM 2  

Read/Write  

Controls intepretation of whitespace (such as leading spaces and line breaks) from the source code.

 
Example
 
document.getElementById("myDIV").style.whiteSpace = "pre";
 
Value

One of the constant values (as a string): normal | nowrap | pre. Value of normal allows browsers to word-wrap lines in block elements and ignore leading spaces. Value of nowrap causes source code not to word-wrap, but still ignores leading spaces. Value of pre preserves leading spaces, extra spaces, and carriage returns in the source code. Note that IE 6 for Windows does not respond to the pre value unless the DOCTYPE element values place the browser into standards compatibility mode.

 
Default

normal


Powered by Linode.