Art*_*tel 1 html prettify google-code-prettify
我有以下代码,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link href="../../../Styles/prettify.css" rel="stylesheet" type="text/css" />
<script src="../../../Scripts/prettify.js" type="text/javascript"></script>
</head>
<body>
<p>And from code behind write following :</p>
<pre class="prettyprint">
protected void Page_Load(object sender, EventArgs e)
{
lblLoading.Text = "Loading News...";
}
</pre>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我无法在结果中看到代码语法.我错过了什么?
结果是这样的:

在线演示如下:http://jsfiddle.net/yKss3/
更改
<body>
Run Code Online (Sandbox Code Playgroud)
至
<body onload="prettyPrint()">
Run Code Online (Sandbox Code Playgroud)
- 下载发行版
- 在文档中包含脚本和样式表(您需要确保服务器上有css和js文件,并调整脚本和链接标记中的路径)
<link href="prettify.css" type="text/css" rel="stylesheet" /><script type="text/javascript" src="prettify.js"></script>- 添加
onload="prettyPrint()"到文档的body标记中.- 修改样式表以获得您喜欢的颜色