想要一個美美的框框可以把code包起來,看了ipay99總算學會了,原來好簡單。最近發現自己以前太懶,參考的東西都只有留下連結,如果對方把網站或部落格關了,連結也就沒戲唱了。所以我還是把它寫下來比較安心。
1. 把底下這段code加在前面
code {
display: block;
font-family: 'Courier New';
font-size: 9pt;
overflow: auto;
border: 1px solid #82c534;
padding: 10px 10px 10px 21px;
max-height: 1200px;
line-height: 1.2em;
letter-spacing: 0px;
color: #000;
background: #e5e6da url(http://pinktealeaf.googlepages.com/code.gif) left top repeat-y;
}
2. 在編輯文章時,在程式碼前後加上<code>和</code>就可以啦。
3. 程式碼中的幾個符號要代換過才會秀出來
2 comments:
Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Vinho, I hope you enjoy. The address is http://vinho-brasil.blogspot.com. A hug.
可以再加上
white-space: pre;
會更整齊喔^^
Post a Comment