简体   繁体   中英

Google Prettify Line numbers and Overflow

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;}

在此处输入图片说明

CSS & IMAGE AFTER:

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

在此处输入图片说明

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;}

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM