插件下载地址:http://code.google.com/p/google-code-prettify/
特点是无须指定语言
使用方法:
1. 包含脚本和样式表
<
link
href
=
"
prettify.css
"
type
=
"
text/css
"
rel
=
"
stylesheet
"
/>
< script type = " text/javascript " src = " prettify.js " ></ script >
< script type = " text/javascript " src = " prettify.js " ></ script >
2. 添加 οnlοad="prettyPrint()" 到你的文件的 body 标签中.
3. 在 <pre class="prettypring">...</pre> 或 <code class="prettypring">...</code> 中间放上代码片段,它就会自动被美化了.
效果图: