Using
 and  tags to display a javascript script

后端 未结 4 2111
南笙
南笙 2020-12-19 02:29

I\'m experimenting with the < pre> and < code> tags in html 5 as I would like to include some code snippets on my website. I\'m using the page below as a test page but

4条回答
  •  执念已碎
    2020-12-19 02:44

    This would work if you take the script tags out.

    These code tags only change the font of the text inside to a monospace font, however it does not override the interpretation of other tags (or even php tags).

    A better way is to use CSS to get color highlighting, or javascript libraries.

提交回复
热议问题