- 在範本中修改html檔,在<header>中插入以下程式碼:
- 在範本中修改html檔,在<body>中加入
- 在範本中修改html檔中收尋 /* Post 並加入以下CSS的修改檔
- 在文章的HTML檔在想顯示程式碼中加入以下標籤
<link href="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.css" rel="stylesheet" type="text/css"></link> <script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js" type="text/javascript"> </script>
onload='prettyPrint();'
.post .code { display: block; /* fixes a strange ie margin bug */ font-family: Courier New; font-size: 10pt; overflow:auto; background: #f0f0f0 url(http://yourweb_images_home/Code_BG.gif) left top repeat-y; border: 1px solid #ccc; padding: 10px 10px 10px 21px; max-height:200px; line-height: 1.2em; }
<pre class="prettyprint code"> 你的code碼 </pre>
不錯的參考資料:HTML Encode 網頁
沒有留言:
張貼留言