Categories
Wordpress

Wrap Preformatted text in WordPress

If your theme isn’t wrapping your Preformatted text (spilling over into your sidebar), all you need to do is edit your style.css file.

Within the “pre” section of your style.css file, replace or add the following text

pre {
 white-space:pre-wrap;
 word-wrap:break-word;
 }

Want to add some basic formatting?

pre {
  white-space:pre-wrap;
  word-wrap:break-word;
  border:1px solid #ccc;
  padding:5px 10px;
  background: #f8f8f8;
  font-size: 12px;
  margin-right: 50px;
  }
Comments

By Tommy Elmesewdy

DevOps Engineer