How Do I Display Html Code (entities) On A Web Page?
how do you write html code so the user and see it on a webpage (like a how-to for html)
Solution 1:
encode your html entities:
< … <
> … >
& … &
" … "
(' … ' xml, not html. see comments)
you might also want to use
<pre><code>
here comes your preformatted and escaped <html>-code
</code></pre>
to have your code monospaced and preserve whitespaces
Solution 2:
You have to use HTML character entities <
and >
in place of the < and > symbols so they aren't interpreted as HTML tags.
Solution 3:
To avoid issues with '
, use '
.
Post a Comment for "How Do I Display Html Code (entities) On A Web Page?"