Whitespace: the 'white-space' property - CSS3 Examples

Whitespace: the 'white-space' property

Written by jon on 11:45 AM
'white-space'
Value: normal | pre | nowrap | inherit
Initial: normal
Applies to: block-level elements
Inherited: yes
Percentages: N/A
Media: visual

This property declares how whitespace inside the element is handled. Values have the following meanings:

normal
This value directs user agents to collapse sequences of whitespace, and break lines as necessary to fill line boxes. Additional line breaks may be created by occurrences of "\A" in generated content (e.g., for the BR element in HTML).
pre
This value prevents user agents from collapsing sequences of whitespace. Lines are only broken at newlines in the source, or at occurrences of "\A" in generated content.
nowrap
This value collapses whitespace as for 'normal', but suppresses line breaks within text except for those created by "\A" in generated content (e.g., for the BR element in HTML).

Example(s):

The following examples show what whitespace behavior is expected from the PRE and P elements, and the "nowrap" attribute in HTML.

PRE        { white-space: pre }
P { white-space: normal }
TD[nowrap] { white-space: nowrap }

Related Posts by Categories



Widget by John | Interviewghost
  1. 0 comments: Responses to “ Whitespace: the 'white-space' property ”

RECENT COMMENTS

SUBSCRIBE TO CSS3 EXAMPLES

 Subscribe to css3 Examples via RSS
Or, subscribe via email:
Find CSS3 Examples Entries :