[ACCEPTED]-How do I display HTML code (entities) on a web page?-html
Accepted answer
encode your html entities:
< … <
> … >
& … &
" … "
(' … ' xml, not html. see comments)
you might also 2 want to use
<pre><code>
here comes your preformatted and escaped <html>-code
</code></pre>
to have your code monospaced 1 and preserve whitespaces
You have to use HTML character entities 2 <
and >
in place of the < and > symbols 1 so they aren't interpreted as HTML tags.
To avoid issues with '
, use '
.
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.