Reputation: 336
I want to display HTML code as it is without rendering.
Current Output
Note : Use
for Line Break.
Expected Output
Note : Use <br> for Line Break.
<html>
<head>
</head>
<body>
Note : Use <br> for Line Break.
</body>
</html>
Upvotes: 4
Views: 7360
Reputation: 3328
You can use <xmp>
but it's deprecated as suggested by @Someone_who_likes_SE. So probably avoid using it.
Mozilla XMP Documentation states:
The HTML element renders text between the start and end tags without interpreting the HTML in between and using a monospaced font.
<html>
<body>
<xmp>Note : Use <br> for Line Break.</xmp>
</body>
</html>
We generally replace the tag brackets with their HTML entities codes
<
becomes <
and >
becomes >
<html>
<body>
Note : Use <br> for Line Break.
</body>
</html>
Upvotes: 7
Reputation: 560
You can show HTML tags as plain text in HTML on a website or webpage by replacing <
with <
or &60;
and >
with >
or &62;
on each HTML tag that you want to be visible. Ordinarily, HTML tags are not visible to the reader on the browser.
Also you can look into this question: Display HTML snippets in HTML
Upvotes: 2