Place your code on the page and surround it with </TT> tag. Set <TT>name</TT> attribute to <TT>code</TT> and <TT>class</TT> attribute to one of the <A href="http://code.google.com/p/syntaxhighlighter/wiki/Languages">language aliases</A> you wish to use. </P><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false;">
... some code here ...
NOTE: One important thing to watch out for is opening triangular bracket . It must be replaced with an HTML equivalent of in all cases. Failure to do won't break the page, but might break the source code displayed.
An alternative to </TT> is to use <TT><textarea></TT> tag. There are no problems with <TT><</TT> character in that case. The main problem is that it doesn't look as good as <TT><pre class="brush:php;toolbar:false;"></TT> tag if for some reason JavaScript didn't work (in RSS feed for example). </P><PRE class=code style="PADDING-RIGHT: 0.5em; PADDING-LEFT: 0.5em; PADDING-BOTTOM: 0.5em; MARGIN-LEFT: 2em; BORDER-LEFT: #ccc 3px solid; PADDING-TOP: 0.5em"><textarea name="code" class="c#" cols="60" rows="10">
... some code here ...
</textarea>
Extended configuration
There's a way to pass a few configuration options to the code block. It's done via colon separated arguments.
... some code here ...
Finally, to get the whole thing to render properly on the page, you have to add JavaScript to the page.
95Shop可以免费下载使用,是一款仿醉品商城网店系统,内置SEO优化,具有模块丰富、管理简洁直观,操作易用等特点,系统功能完整,运行速度较快,采用ASP.NET(C#)技术开发,配合SQL Serve2000数据库存储数据,运行环境为微软ASP.NET 2.0。95Shop官方网站定期开发新功能和维护升级。可以放心使用! 安装运行方法 1、下载软件压缩包; 2、将下载的软件压缩包解压缩,得到we
0
<link type="text/css" rel="stylesheet" href="css/SyntaxHighlighter.css"></link>
<script language="javascript" src="js/shCore.js"></script>
<script language="javascript" src="js/shBrushCSharp.js"></script>
<script language="javascript" src="js/shBrushXml.js"></script>
<script language="javascript">
dp.SyntaxHighlighter.ClipboardSwf = '/flash/clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code');
</script>For optimal result, place this code at the very end of your page. Check HighlightAll for more details about the function.
下载地址:SyntaxHighlighter_1.5.0.zip
java怎么学习?java怎么入门?java在哪学?java怎么学才快?不用担心,这里为大家提供了java速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号