Wrapping long lines in <pre> tags

[2011-01-29] dev, hack, html5
(Ad, please don’t block)
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>