Posted by Mitja Trampus on 07/04/06 16:13
Toby Inkster wrote:
> Mike wrote:
>
>> To add insult to injury: I styled <pre> so that snippets would be
>> surrounded by borders and had different spacing and size. Looks great.
>> Really simple stuff. Contrariwise, the same changes to <code> resulted
>> in a disaster.
>
> That's because CODE is inline and PRE is block.
> For big blocks of code, it's a good idea to use:
> <pre><code> ... </code></pre>
One more alternative:
Since PRE has no semantic meaning, I prefer to use
<code class="snippet"> ... </code>
in combination with
code.snippet {
display: block;
white-space: pre;
}
Navigation:
[Reply to this message]
|