The White-space property of the CSS is used to specify how to handle white space characters in the container, such as: space (), newline (\ n), indentation (\ t), and so on.
White-space from CSS1, applicable to block elements, with inheritance, support IE 5.5+, Chrome, FireFox, Safari, opera and other mainstream browsers, the default value is normal.
Grammar:
White-space:normal | Pre | NoWrap
Parameters:
Normal: Default processing mode
Pre: Displays preformatted text in equal-width font. Do not combine whitespace distances between words and justify them. See Pre objects
NoWrap: Forces the display of all text within the same line until the text ends or encounters a BR object. See NoWrap Properties (attributes) for objects such as Td,div
Description
Sets or retrieves how spaces within an object are handled.
The corresponding script attribute is whitespace. Please refer to the other bibliography I have written.
Example:
p {white-space:nowrap;}
Description
White-space supports normal, pre, nowrap, Pre-wrap, Pre-line, inherit equivalents. Let's take a detailed description of the differences between these values.
JavaScript operations
White-space the corresponding property name in JavaScript is whitespace, for example:
document.getElementById ("P1"). Style.whitespace = "nowrap";
The whitespace property on the Style object is read-write, but the whitespace property on the Currentstyle object is read-only.