Google Prettify行号和溢出

时间:2012-10-14 17:41:07

标签: html prettify google-code-prettify

向Google美化元素添加溢出时,行号会消失。

不变的CSS:

pre
{    
    font-size:11px;
    background-color:white;
}
/* Alternate shading for lines */     li.L1,
li.L3,
li.L5,
li.L7,
li.L9 { background: #eee; width:200%;}

CSS&图像之前:

pre.prettyprint { padding: 2px; border: 1px solid #888;}

enter image description here

CSS&图像后:

pre.prettyprint { padding: 2px; border: 1px solid #888; overflow:auto;}

enter image description here

1 个答案:

答案 0 :(得分:1)

显然这些数字位于pre.prettyprint元素的填充中。如果我将左边的填充增加到30px且溢出'on',我可以看到数字。我将不得不更多地梳理CSS(它是继承的)

CSS改变&结果输出:

pre.prettyprint { padding-left:30px; border: 1px solid #888; overflow: auto;}

enter image description here