Skip to content

Instantly share code, notes, and snippets.

@tnylea
Created June 28, 2012 23:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save tnylea/3014567 to your computer and use it in GitHub Desktop.
Save tnylea/3014567 to your computer and use it in GitHub Desktop.
CSS to add un-selectable line numbers to your github gists
.gist {
border-left: 3ex solid #eee;
position: relative;
}
.gist pre {
counter-reset: linenumbers;
}
.gist pre div:before {
color: #aaa;
content: counter(linenumbers);
counter-increment: linenumbers;
left: -3ex;
position: absolute;
text-align: right;
width: 2.5ex;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment