in reply to Re: Change default style sheet: add line numbers
in thread Change default style sheet: add line numbers

I originally had (cadged from Anonymous Monk in this post) div.codeblock in the counter reset list, but that had the unfortunate effect of making small codeblocks (ones without the download link) all have the same line number). (While I learned more about CSS, I didn't learn enough about know/explain why.)

Thats odd, the one liners are class inlinecode not codetext , but this should work as well and not need font tags

pre.code div.codeblock tt.codetext { counter-reset: codeLineCounter; } pre.code div.codeblock tt.codetext i::before { counter-increment: codeLineCounter; content: counter(codeLineCounter,decimal-leading-zero) ": "; -moz-user-select: -moz-none; -khtml-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; float: left; width: 3em; text-align: right; color: purple; }

And I think that  user-select: none; stuff might work with the regular "code prefix" line numbers feature

I can always turn off line wrapping.

Why don't you turn on soft-hyphen line wrapping? I think that select: none; might help with the soft-hyphen not being copy/pasted

Replies are listed 'Best First'.
Re^3: Change default style sheet: add line numbers ( user-select: none; )
by Anonymous Monk on Apr 05, 2015 at 09:22 UTC
    so
    .unselectable, .line-breaker { -moz-user-select: -moz-none; -khtml-user-select: none; -webkit-user-select: none; -ms-user-select: none; user-select: none; }