- From: Jukka K. Korpela <jkorpela@cs.tut.fi>
- Date: Mon, 20 Aug 2007 14:57:45 +0300 (EEST)
- To: Brian Timmins <brtimmins@googlemail.com>
- cc: www-validator@w3.org
On Mon, 20 Aug 2007, Brian Timmins wrote: >> <textarea cols="82" rows="1"> >>> <a href="http://www.brianstimelines.co.uk/index.html">Brian's Timelines: >>> Home Page</a> >>> </textarea> >> >> According to the HTML4 (and thus XHTML 1.0), the textarea element can >> only take PCDATA content, in other words, "plain text, no child >> element". > > OK. So how does one present code snippits on a webpage? That's more of an authoring issue than a validation problem, but briefly the principle is to encode each "<" as "<" and each "&" (in data) as "&". In addition to this, and independently of it, it is logical to use <code> markup, since HTML markup is "computer code" in a broad sense. This also makes browsers use a monospace font, even in the absence of a style sheet. Thus, you could write <code><a href="http://www.brianstimelines.co.uk/index.html">Brian’s Timelines:>Home Page</a></code> (Using ’, the "typographer's apostrophe", instead of ' is independent of the other issues and mainly a typographic thing.) Problems with HTML markup in general are perhaps best discussed in news:comp.infosystems.www.authoring.html -- Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Received on Monday, 20 August 2007 11:57:57 UTC