0
How can I display html code in webpage??
2 Respostas
+ 2
code : < span >
displays this: <span>
< is less than.
> is greater than.
If it's long code you can also embed it from gist : https://gist.github.com/
Note : Don't write question in tags.
+ 1
By using <code>your HTML code</code> tag.
But before that, you need to usescape your HTML code(convert < and > to it's character entity code i.e. < and > respectively. For that you can use any HTML usescape online tool. This is a good and better online HTML escape unescape tool:
https://codebeautify.org/html-escape-unescape
example this on your source code:
<code>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>Hello</p>
</body>
</html>
</code>
will display this on your webpage.:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>Hello</p>
</body>
</html>