Free email newsletter: “ES.next News

2011-01-29

Wrapping long lines in <pre> tags

To get long lines in pre tags to wrap, insert the following in the head:
    <style type="text/css">
        .wrapit {
            white-space: pre-wrap;
        }
    </style>
Then use as follows.
    <pre class="wrapit">
        ...
    </pre>
If you write “pre” instead of “.wrapit”, all pre tags will be wrapped and no CSS class needs to be specified. You can also directly insert the style information:
    <pre style="white-space: pre-wrap">
        ...
    </pre>
Flattr

No comments: