在文章裡顯示優質的程式碼區

此效果參考 http://klcintw4.blogspot.com/2006/11/blog-post_03.html


加上CSS

CODE {
display: block; /* fixes a strange ie margin bug */
font-family: Courier New;
font-size: 8pt;
overflow:auto;
background: #f0f0f0 url(http://klcintw.images.googlepages.com/Code_BG.gif) left top repeat-y;
border: 1px solid #ccc;
padding: 10px 10px 10px 21px;
max-height:200px;
height:200px; // for IE6
line-height: 1.2em;
}




在文章中將程式碼置於<code></code>區塊中即可,結果如 http://tomda543.blogspot.com/2008/07/code.html 所示

沒有留言:

張貼留言