Why <code> & <pre> can't to display code html tags in output display | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Why <code> & <pre> can't to display code html tags in output display

(i.e) <pre> <img src="pic.jpg"/></pre> will display image, instead code, same result to <code>

29th May 2020, 11:14 AM
Unknown Ambusher 🗡️
Unknown Ambusher 🗡️ - avatar
2 Answers
+ 6
You have to use HTML special characters for that. <pre> &lt;img src="myimg.jpg" /&gt; </pre> If you don't want to use that you can use <xmp> tag. <xmp> <img src="myimg.jpg" /> </xmp>
29th May 2020, 11:46 AM
Raj Chhatrala
Raj Chhatrala - avatar
+ 3
29th May 2020, 12:38 PM
Unknown Ambusher 🗡️
Unknown Ambusher 🗡️ - avatar