How to wrap text in a pre tag with CSS?

Spread the love

Sometimes, we want to wrap text in a pre tag with CSS.

In this article, we’ll look at how to wrap text in a pre tag with CSS.

How to wrap text in a pre tag with CSS?

To wrap text in a pre tag with CSS, we can use the white-space property.

For instance, we write

pre {
  white-space: pre-wrap;
}

to set white-space to pre-wrap to wrap the text in a pre element.

Conclusion

To wrap text in a pre tag with CSS, we can use the white-space property.

Leave a Reply

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