HomeReferencesCSS Properties

CSS Property: white-space

Specifies how the white space (such as new lines or a sequence of spaces) inside a box should be handled.

HTML Dog, The Book HTML Dog book cover

HTML Dog is hosted by Titan Internet

Possible Values

  • inherit
  • normal - White space is collapsed and lines are broken to fit.
  • pre - White space is maintained and lines are not broken. The equivalent of the default styling of the HTML pre element.
  • nowrap - White space is collapsed but lines are not broken.
  • pre-wrap - White space is maintained but lines are broken. Not recognized by IE.
  • pre-line - White space is collapsed except for new lines, which are not. Lines are also broken to fit. Not recognized by IE.

Example


pre { white-space: normal; }

#pow { white-space: pre; }