Reply to Re: Noob: Code & Pre tags...

Your name:

Reply:


Posted by Jukka K. Korpela on 07/04/06 23:04

Mitja Trampus <nun@example.com> scripsit:

> Since PRE has no semantic meaning, I prefer to use
>
> <code class="snippet"> ... </code>
>
> in combination with
>
> code.snippet {
> display: block;
> white-space: pre;
> }

The PRE element has a meaning: it indicates a block of preformatted text.
(And it is a semantic meaning. "Semantic" means "relating to meaning", so
"semantic meaning" is just an emphatic expression for "meaning".)

On the practical side, your approach implies that in any non-CSS rendering
situation, the entire code snippet is rendered as running text, without
preserving whitespace. Besides, there will be problems in CSS-enabled
rendering, too, since support to white-space: pre is not universal.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

[Back to original 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

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