Home·CSS properties

white-space

Text

Controls how spaces and line breaks are handled; nowrap keeps everything on one line.

How to write itwhite-space: normal;
Common valuesnormal, nowrap, pre, pre-wrap
InheritedYes — children receive it
CategoryText

How to read this

  • An inherited property only needs writing once on the parent — every child picks it up. Most text properties work this way.
  • A shorthand resets whatever you leave out. Writing background: red alone also wipes a background image you set earlier.
  • When rules collide, the more specific selector wins; only when specificity ties does source order decide.
  • Animate transform and opacity for smoothness. Changing width or top forces the layout to be recalculated.

Frequently asked questions

Q. What is the CSS white-space property?

Controls how spaces and line breaks are handled; nowrap keeps everything on one line.

Q. How do you write white-space?

As white-space: normal; Common values include normal, nowrap, pre, pre-wrap.

Q. Is white-space inherited?

Yes. Set it once on the parent and every child uses the same value without repeating it.

Q. What group does white-space belong to?

The text group.

Properties in the same group

Reference docs