Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Highlight.js中显示Html标签?_Html_Syntax Highlighting_Highlight.js - Fatal编程技术网

如何在Highlight.js中显示Html标签?

如何在Highlight.js中显示Html标签?,html,syntax-highlighting,highlight.js,Html,Syntax Highlighting,Highlight.js,我想用Hello World! 智力? 但它表明,在 <pre> <code > <p>Hello World ! </p> </code> </pre> 你好,世界 您可以在JQUERY中使用append()。但在highlight js中很难匹配特定的语言 但是你最好使用attr来手动获取你正在使用的代码 我这里有简单的代码 $(文档).ready(函数(){ 变量e=$(“前代码”), l=“你

我想用Hello World!

智力? 但它表明,在

<pre>

<code >

    <p>Hello World ! </p>

</code>

</pre>


你好,世界

您可以在JQUERY中使用append()。但在highlight js中很难匹配特定的语言

但是你最好使用attr来手动获取你正在使用的代码

我这里有简单的代码

$(文档).ready(函数(){
变量e=$(“前代码”),
l=“

你好,世界!

”, i={border:'solid 1px#222',background:'222',display:'inline block',height:'auto',padding:'0',lineHeight:'1.375rem',position:'absolute',margin:'-6px 9px',top:'auto right:'2px',textAlign textSize:'13px',color:'fff',borderRadius:'3px',zIndex:'30',mobility:'8',transition:'all.5s ease in'; e、 附加(l); $(“p.windowLabel”).css(i); });
您能提供您的代码吗?
$(document).ready(function() {
var e = $("pre code"),
      l = "<p class='windowLabel'>Hello World !</p>",
    i = { border: 'solid 1px #222',background: '#222',display: 'inline-block',height: 'auto',padding: '0', lineHeight: '1.375rem',position: 'absolute',margin: '-6px 9px',top: 'auto',right: '2px',textAlign: 'center',textTransform: 'uppercase',fontSize: '13px',color: '#fff',borderRadius: '3px',zIndex: '30', opacity: '.8',transition: 'all .5s ease-in'};
    e.append(l);
   $("p.windowLabel").css(i);
});