As an alternative the solution to escape/replace the characters can be used <textarea>
to display the code. Just use the property readonly
and remove the edges of the element:
textarea {
border: none;
resize: none
}
<textarea readonly rows='10' cols='40'>
<!doctype html>
<html lang='pt-br'>
<head>
<title>StackOverflow pt</title>
</head>
<body>
<!-- ... -->
</body>
</html>
</textarea>
Just as a curiosity: there was a tag <xmp>
which allowed you to display text without interpreting it as HTML. In some browsers, the code below may still work. Remembering that it is an obsolete tag and its use is discouraged, the snippet is only as a matter of curiosity:
<xmp>
<!doctype html>
<html lang='pt-br'>
<head>
<title>StackOverflow pt</title>
</head>
<body>
<!-- ... -->
</body>
</html>
</xmp>
Opa Renan, I managed to solve, I found even a plugin
run_prettify.js
and everything worked perfectly. But thank you for your reply.– Guilherme SpinXO