[thelist] apply PRE formatting with css?

aardvark roselli at earthlink.net
Thu Aug 30 23:07:59 CDT 2001


> From: nate koechley <nate at vicksburgcollective.com>
> 
> i was wondering if there was a way to achieve this:
> <div><pre>
>  source code
> </pre></div>
> without the <pre> tags. in other words, can I apply "pre" formatting
> by using CSS? I'm tyring to find the best way to display source code
> on a page. is there a best practice out there to display source code
> on the page?

yes, use <pre>...

what about using <pre> doesn't appeal to you?  it's probably the 
best way to represent it... and it offers some semantic value as 
well...

you could use the inline equivalent of <pre> (which is block-level) -- 
<code>... i'm assuming you don't like <pre> because it doesn't 
wrap the text... well, you could use <p><code></code></p> and it 
would still have some semantic value...

then just style the <code> element in your CSS...

> on a related note, does anybody have a script or homesite extension
> form translating all the [< ] to [ &lt; ] (acutally, all the carets,
> quotes, etc...)?

search-n-replace should handle much of what you need...




More information about the thelist mailing list