Skip to main content

HTML Guide

CSS: “white-space”: X is not a “white-space” value.

Invalid values have been assigned to the white-space CSS property.

The white-space property in CSS controls how whitespace and line breaks inside an element are handled. Only specific values are valid for this property. According to the CSS specification, valid values for white-space include:

/* Single keyword values */
white-space: normal;
white-space: pre;
white-space: pre-wrap;
white-space: pre-line;

/* white-space-collapse and text-wrap-mode shorthand values */
white-space: wrap;
white-space: collapse;
white-space: preserve nowrap;

/* Global values */
white-space: inherit;
white-space: initial;
white-space: revert;
white-space: revert-layer;
white-space: unset;

Learn more:

Last reviewed: May 08, 2025

Was this guide helpful?

Related W3C validator issues