How to Wrap Text in PRE Tag?

In HTML, if you are using PRE tag for preformatted text and the text is getting hidden, then use white-space and overflow-x CSS values for PRE tag. Below is the example:

CSS To Wrap Text in PRE Tag

pre {
    position: relative;
    max-width: 800px;
    padding: 30px 15px;
    background: #f7f7f7;
    word-break: break-all;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 14px;
    color: #666666;
    border-left: 3px solid #7b7b7b;
    overflow-x:scroll;
}

The output of the above CSS would be the same as it is displaying above for CSS code. Below is the image:

Wrap text in PRE tag using CSS

Comments

Popular posts from this blog

How To Write Query in Toad for Oracle?

How to Kill Session in Toad for Oracle?

How to Change Password in Toad for Oracle?