admin管理员组

文章数量:1279234

Does anyone have an example on how to use HTML5 code tag in order to display HTML code?

I tried to do that but it failed.

Afterwards, I tried to use highlight.js but still no luck.

Any suggestions?

Demo

Does anyone have an example on how to use HTML5 code tag in order to display HTML code?

I tried to do that but it failed.

Afterwards, I tried to use highlight.js but still no luck.

Any suggestions?

Demo

Share Improve this question asked Jun 11, 2012 at 17:36 glarkouglarkou 7,10112 gold badges69 silver badges122 bronze badges 2
  • Highlight.js is perfect for what you are looking for. What is wrong with your attempt to try it? have you seen the demos? softwaremaniacs/media/soft/highlight/test.html – John Riselvato Commented Jun 11, 2012 at 17:40
  • Take a look at the demo. It is not working. I tried the demos. I am not sure what I am doing wrong. No error or something. Neither HTML5 or Highlight.js are working – glarkou Commented Jun 11, 2012 at 17:41
Add a ment  | 

2 Answers 2

Reset to default 8

The HTML code tag has nothing to do with beautifying. It simply indicates its content as puter code, and by default it causes it to be rendered in a monospace font. That’s all.

To get help with beautification, I suggest that you open a new question and post your best effort so far (not links to general resources but to code that you actually tried) and explain what you wish to achieve.

You would need to replace < tag with &lt; and > with &gt;. Only by escaping these characters can you see the html code

本文标签: javascriptHow to use HTML5 code tag to beautify codeStack Overflow