Helle friend's, how can i make a juck of html code within an html document to be rendered as text.... | Sololearn: Learn to code for FREE!

+7

Helle friend's, how can i make a juck of html code within an html document to be rendered as text....

I am writing a blog, so I want to give an HTML example, but I want the HTML example to be rendered as pure text, not to be included with the other HTML code... https://code.sololearn.com/Wulk2Rgp1xZF/?ref=app

6/28/2022 12:56:12 PM

🤖Web Gig🤖

6 Answers

New Answer

+6

Use &lt; and &gt; instead of < and > respectively. A lot more to write, but it works! Correct me if there is any other way

+4

You can try <pre> tag or there is lot of js library for hilighting codes in web view like highlight.js , prism.js etc.... You can try one of them for better appearance 😉 🙏 🙃👍

+3

ㅤMr. N♡ ♡N€☆ ㅤㅤ thanks bro ..

+2

🇺🇦 GUMBALL 🇺🇦 ok bro...

+2

Maybe with a little Javascript? ('<a_tag>Content</a_tag>').replace(/</g, '&lt;').replace(/>/g, '&gt;');

0

wrap it in a pre tag, it will preserve it or code tag