How to display code in code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How to display code in code

So I created a h1 tag and created another h1 tag in it. But it doesn't display it. I want to display an example code in output. Can I plz have the most simple code example about that? Thanks

7th Apr 2021, 11:47 PM
Michael
Michael - avatar
1 Answer
+ 3
You can do this by replacing < with &lt and > with &gt So if you wanted to put h1 in a h1 tag just put <h1>&lth1&gt&lt/h1&gt</h1>
8th Apr 2021, 12:53 AM
Pieter Edwards
Pieter Edwards - avatar