Loading...
2009-05-20

[Blogger]在blogger文章中顯示程式碼區

這篇文章是從良人的大秘寶在文章裡顯示優質的程式碼區)學來的,個人純粹是拿來應用並做筆記記錄,若有興趣的朋友,請連回原作者參考。

一、以下貼在</head>之前

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>之間;若文章內容有html程式碼,則最好用html編輯器轉譯成原始碼。

0 意見:

張貼留言

 
TOP