星期三, 5月 09, 2007

於Blog中使用程式碼區塊功能

於Blog的樣板中,在CSS中插入以下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;
line-height: 1.2em;
}


在文章中將程式碼置於<code></cdoe>區塊中即可,如:
<code>
.comment-body-author {
margin:0;
padding:0 0 0 20px;
background-color:#C0C0C0;
}</code>

沒有留言: