Show HTML Source Code without Being Interpreted by Browsers

Q

How can I show HTML examples without them being interpreted as part of my document?

✍: FYIcenter

A

Within the HTML example, first replace the "&" character with "&amp;" everywhere it occurs. Then replace the "&lt;" character with "<" and the "&gt;" character with ">" in the same way.
Note that it may be appropriate to use the CODE and/or PRE elements when displaying HTML examples.

2007-03-03, 5960👍, 0💬