Re: Error in XHTML Validator???

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 "&lt;" and each "&" (in data) as 
"&amp;". 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>&lt;a 
href="http://www.brianstimelines.co.uk/index.html">Brian&#8217;s 
Timelines:>Home Page&lt;/a></code>

(Using &#8217;, 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