A
A
Alexander2017-11-03 12:43:34
css
Alexander, 2017-11-03 12:43:34

How to implement line highlighting so that the text can be selected and copied?

There is a small code for syntax highlighting. It's kind of like the developer tools in Google Chrome. When you hover over a specific line, it is highlighted. Looks good. However, line highlighting does not allow text to be selected by swiping horizontally with the cursor.
How can this problem be solved, given that some elements may wrap to other lines?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
KazeZlat, 2017-11-03
@codemafia

It's the pseudo-element that follows the .code-line. It covers your selection area.
Adding to properties will help avoid this. .code-line:afterpointer-events: none;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question