How to make a DIV not wrap with CSS?

Spread the love

Sometimes, we want to make a DIV not wrap with CSS.

In this article, we’ll look at how to make a DIV not wrap with CSS.

How to make a DIV not wrap with CSS?

To make a DIV not wrap with CSS, we use the white-space property.

For instance, we write

div {
  display: inline-block;
  white-space: nowrap;
}

to add white-space: nowrap; to make the div’s content stay in 1 row.

Conclusion

To make a DIV not wrap with CSS, we use the white-space property.

Leave a Reply

Your email address will not be published.