[Discuss] HTML formatting question

Adam Parkin pzelnip at telus.net
Fri Oct 13 10:50:46 PDT 2006


A question for the HTML gurus out there....

I have an HTML document which has sections of <pre>formatted text, and 
what I want is for different parts of the text inside the <pre></pre> 
block to be coloured different colours.  I initially tried doing:

<pre>
<font color="red">some
		text</font>
<font color="blue">some more
		text</font>
</pre>

But the w3 validator chokes on this as apparently you cannot have a font 
tag inside a pre tag.  I thought okay maybe we use styles like so:

<pre style="color: red">some
		text</pre>
<pre style="color: blue">some more
		text</pre>

But of course the two pre tags cause a carriage return between the two 
blocks of text (defeating the whole point of using pre in the first place).

Any suggestions?
-- 
--
Adam Parkin
E-mail: pzelnip at telus.net
----------------------
  If one man offers you democracy and another offers you a bag of grain, 
at what stage of starvation will you prefer the grain to the vote?
	-- Bertrand Russell


More information about the Discuss mailing list