Copyright © tutorialspoint.com

CSS - white-space

previous next


Description:

The white-space property is used to alter the user agent's handling of whitespace in an element.

Possible Values:

Applies to:

All the Block level elements

DOM Syntax:

object.style.whiteSpace="pre";

Example:

Following is the example which demonstrates how white space inside an element is handled.

<p style="white-space:pre;">This text has a line break
and the white-space pre setting tells the browser to honor it
just like the HTML pre tag.</p>

This will produce following result:

This text has a line break and the white-space pre setting tells the browser to honor it just like the HTML pre tag.

To Become more comfortable - Do Online Practice


previous next

Copyright © tutorialspoint.com