Skip to content


Make code copying easier with :before

CSS1 min read

Make code copying easier with :before

Originally published here

This happens often, if you are developing some documentaion generator or code highlighter make sure to do this.

Whenever you try to copy code that looks like this

Btw this is an image don’t try on this

Double click on that line, you will select something like this

and when pasted you get something like this

To fix this,

Now when you double click the line, this happens

Now when you copy at this stage and paste it you will get this

Before and after the :before 😜

Images from