我试图突出显示一些语法使用谷歌美化,但到目前为止,它不工作。
<link href="prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="prettify.js"></script> <body onload="prettyPrint()" bgcolor="white"> <pre class="prettyprint"> <code class="language-css"> // Some source code class Foo { public int Bar { get; set; } } </code> </pre>
解决方法
编辑:对于twitter bootstrap 2.0.x,它适用于2.1.x
http://twitter.github.com/bootstrap/assets/js/google-code-prettify/prettify.css
http://twitter.github.com/bootstrap/assets/js/google-code-prettify/prettify.js
这对我有用
<!DOCTYPE html> <html lang="en"> <head> <link href="css/bootstrap.css" type="text/css" rel="stylesheet" /> <link href="prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="prettify.js"></script> </head> <body onload="prettyPrint()" bgcolor="white"> <pre class="prettyprint linenums languague-css"> // Some source code class Foo { public int Bar { get; set; } } </pre> </body> </html>