Skip to content

Instantly share code, notes, and snippets.

@thefonso
Forked from potch/gist_line_numbers.css
Created December 1, 2012 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefonso/4185606 to your computer and use it in GitHub Desktop.
Save thefonso/4185606 to your computer and use it in GitHub Desktop.
CSS to add line numbers to embedded gists
.gist-highlight {
border-left: 3ex solid #eee;
position: relative;
}
.gist-highlight pre {
counter-reset: linenumbers;
}
.gist-highlight pre div:before {
color: #aaa;
content: counter(linenumbers);
counter-increment: linenumbers;
left: -3ex;
position: absolute;
text-align: right;
width: 2.5ex;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment