Posted by Andy Dingley on 11/25/63 11:54
John O'Conner wrote:
> I've been told that I can no longer use pre-tags for code sample text.
This is a stupid decision. If you've had an outbreak of pointy-haired
boss, then you have my sympathy.
> My question is this: how can I duplicate the pre-tag functionality
Dead easy - just use <div class="pre" > and some CSS. There's nothing
at all magic about <pre>, it's just CSS effects.
If you examine the W3C's suggested default stylesheet, you'll see just
the CSS to use
http://www.w3.org/TR/CSS21/sample.html
The crucial bit would be
div.pre { white-space: pre; }
I suggest you might avoid the monospaced font in your replacement -
that way they'll probably not notice how closely you've cloned <pre>
8-)
[Back to original message]
|