Re: Displaying source code - is this a tidy or an html issue?

On Wed, 1 Sep 1999, Larry W. Virden wrote:

 Hello, Larry!

 The <code> tag is designed only to select text style reasonable for
displaying "machine code" (it's like <strong>,<em> - no special treatment of
content). You should use <pre> and use named enities like &lt; for your
example.

> If I have a web page on which I wish to display source code, I thought
> that all I needed to do was include the code thusly:
> 
> 
> <html>
> <head>
> <title>test code</title>
> </head>
> <body>
> <code>
> #include <stdio.h>
> int main(int argc, char **argv)
> {
> 	fprintf(stdout, "Hello, world (%s)\n", argv[1]);
> 	return 0;
> }
> </code>
> </body>
> </html>

 Best regards,
 -Vlad

Received on Wednesday, 1 September 1999 08:23:36 UTC