Google Prettify Line numbers and Overflow

1.5k Views Asked by At

When adding overflow to Google prettify elements, the line numbers disappear.

Unchanged 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 & IMAGE BEFORE:

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

enter image description here

CSS & IMAGE AFTER:

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

enter image description here

1

There are 1 best solutions below

0
On

Apparently the numbers were in the padding of the pre.prettyprint element. If I increase the left padding to 30px with the overflow 'on', I can see the numbers. I'll have to comb over the CSS some more (it was inherited)

CSS change & the resulting output:

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

enter image description here