码迷,mamicode.com
首页 > 其他好文 > 详细

解决在用google-code-prettify高亮博客的代码,但是行号怎么也无法显示

时间:2014-09-22 17:52:03      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   ar   2014   div   sp   on   

在网上查了一下,有一个不太完美的解决办法,就是加入如下代码:
<style>
li.L0, li.L1, li.L2, li.L3, li.L5, li.L6, li.L7, li.L8 {
 list-style-type: decimal !important
}
</style>

然后再将你需要显示的代码里面的<br/>换成回车即可,这样就可以显示出来行号了。
 <pre class="prettyprint pre-scrollable linenums">
   &lt;div class=&quot;span4&quot;&gt;
        &lt;h2 class=&quot;page-header&quot;&gt;区块1&lt;/h2&gt;
            &lt;/div&gt;
         &lt;div class=&quot;span4&quot;&gt;
     &lt;h2 class=&quot;page-header&quot;&gt;区块2&lt;/h2&gt;
 &lt;/div&gt;</pre>

效果如下:
bubuko.com,布布扣

bubuko.com,布布扣

解决在用google-code-prettify高亮博客的代码,但是行号怎么也无法显示

标签:style   blog   http   color   ar   2014   div   sp   on   

原文地址:http://blog.csdn.net/shijiebei2009/article/details/39476879

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!