有时要在wordpress发表一些代码,如html代码、编程语言等,在网上搜索了一下,大致有如下方法:
1. 使用xmp标记
2. 使用pre标记
3. 使用插件,所谓语法代码高亮插件
我不想使用插件方法,试用了xmp标记,它居然把
这些都显示出来了,经比较觉得用pre还可以,具体方法就是在wordpress编辑器中点“Html”,然后把代码部分用<pre>和</pre>包起来。
如下效果:
blockquote, pre {
background:#F4F5F7 url(img/blockquote.gif) 3px 3px no-repeat;
border:1px dashed #CCC;
padding:8px 12px 8px 36px;
margin:5px 0;
} 2016年10月
共有(1)文章
2016年1月
共有(1)文章
2015年5月
共有(1)文章
2014年6月
共有(1)文章
2013年9月
共有(1)文章
2013年3月
共有(2)文章
2012年8月
共有(4)文章
2012年7月
共有(2)文章
2012年6月
共有(5)文章
2012年5月
共有(9)文章
2012年4月
共有(30)文章
2012年3月
共有(67)文章
2008年12月
共有(1)文章