.overflow-content > div[contenteditable="true"]:before{ content: counter(line); margin-right: 25px; } .overflow-content > div[contenteditable="true"]{ counter-increment: line; }