关于如何在网页上显示/展示HTML标记的想法 [英] Ideas on how to display/present HTML tags on a webpage

查看:103
本文介绍了关于如何在网页上显示/展示HTML标记的想法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将HTML写入网页,但是将其呈现为文字?

Is there a way to write HTML onto a webpage, but have it rendered as text?

让我解释一下:我想建立一个网页, HTML。因此,会有

Let me explain: I want to build a webpage with a discussion on HTML. Therefore there will be sections like

<div>
    <p>
        <span>Hello world</span>
    </p>
</div>

我希望用缩进格式正确地格式化,甚至可能使用不同的颜色方案。

I would like that to formatted properly with indentation, and perhaps even have the tags in a different colour scheme.

我完全知道我可以自己写这个样式,但肯定有人已经写了一个样式表,一个LESS混合,或者一个jQuery插件,它识别和格式化为我?

I'm fully aware that I could write the styling for this myself, but surely someone has already written and made available a stylesheet, a LESS mixin, or perhaps a jQuery plugin which recognises and formats for me?

更新:只是为了让人们知道,我意识到,我必须HTML编码的标签(& lt; )。但是这对格式化/演示没有帮助,而是我正在寻找帮助的格式化/演示。

UPDATE: Just to make people aware, I realise that I have to HTML-encode the tags (&lt; and &gt;). But that doesn't help with the formatting/presentation, and it's the formatting/presentation that I'm looking for help with.

推荐答案

p>您正在查找SyntaxHighlighter。请参见演示页面

You are looking for SyntaxHighlighter. See demo page here

这篇关于关于如何在网页上显示/展示HTML标记的想法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆