Categories
CSS

How to turn off word wrapping in CSS?

Spread the love

To turn off word wrapping in CSS, we set thr white-space property.

For instance, we write

div {
  white-space: pre-wrap;
}

to add the white-space: pre-wrap; style to turn off word wrapping in the div.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *