时间:2021-07-01 10:21:17 帮助过:9人阅读
<link type="text/css" rel="stylesheet" href="images/Styles/SyntaxHighlighter.css"></link>
3、在网页要显示程序源代码的地方插入以下代码(其中的class="js"表示以js语法显示源代码,其他可设定的class值分别为
c#、css、c、delphi、java、js、php、python、ruby、sql、vb、xml):
代码如下:
<textarea name="code" class="js" rows="15" cols="100">
//程序源代码放在这儿
</textarea>
4、在网页尾部的</body>之前插入以下代码:
代码如下:
<script class="javascript" src="images/Scripts/shCore.js"></script>
<script class="javascript" src="images/Scripts/shBrushCSharp.js"></script>
<script class="javascript" src="images/Scripts/shBrushPhp.js"></script>
<script class="javascript" src="images/Scripts/shBrushJScript.js"></script>
<script class="javascript" src="images/Scripts/shBrushJava.js"></script>
<script class="javascript" src="images/Scripts/shBrushVb.js"></script>
<script class="javascript" src="images/Scripts/shBrushSql.js"></script>
<script class="javascript" src="images/Scripts/shBrushXml.js"></script>
<script class="javascript" src="images/Scripts/shBrushDelphi.js"></script>
<script class="javascript" src="images/Scripts/shBrushPython.js"></script>
<script class="javascript" src="images/Scripts/shBrushRuby.js"></script>
<script class="javascript" src="images/Scripts/shBrushCss.js"></script>
<script class="javascript" src="images/Scripts/shBrushCpp.js"></script>
<script class="javascript">
dp.SyntaxHighlighter.HighlightAll('code');
</script>