You are here: Re: Noob: Code & Pre tags... « HTML « IT news, forums, messages
Re: Noob: Code & Pre tags...

Posted by Mike on 07/04/06 14:31

On 2006-07-03 18:15:05 -0400, Toby Inkster
<usenet200606@tobyinkster.co.uk> said:

> 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>
>
> as you've discovered. But if you want to include a tiny bit of code
> mid-paragraph, just <code>...</code> will do nicely. For example:
>
> http://tobyinkster.co.uk/web-abbr
>
> If you are marking up code in several different languages, you may find it
> useful to use classes, e.g.:
>
> <code class="html">&lt;BODY&gt;</code>
> <code class="css">margin-left: 1em;</code>
> <code class="perl">$_++</code>
>
> More fun:
> http://test.tobyinkster.co.uk/Preview/Syntax-Highlighting/test.php

Thanks! Nice site, btw.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация