How to prevent column break within an element with CSS?

Spread the love

Sometimes, we want to prevent column break within an element with CSS.

In this article, we’ll look at how to prevent column break within an element with CSS.

How to prevent column break within an element with CSS?

To prevent column break within an element with CSS, we set the break-inside CSS property.

For instance, we write

.x li {
  break-inside: avoid-column;
}

to use break-inside: avoid-column; to prevent column breaks on the li elements in the list with class x.

Conclusion

To prevent column break within an element with CSS, we set the break-inside CSS property.

Leave a Reply

Your email address will not be published.