css – Selecting and copying words to clipboard in browser html, there is no spacing between different element words-ThrowExceptions

Exception or error:

I just found out that when copying text to clipboard from different html elements, no spacing gets added between two different words. For example: <div>hello</div><div>world</div>

When selecting the words, the clipboard will be “helloworld”.

What I found out is that when there is a spacing in one of the divs and gets selected, then space gets added every time. Example: <div>hello 1</div><div>world</div>

Now when selecting the words, the clipboard will be “hello 1 world”

So my question is: is there a known css/html trick when copying to clipboard to force spacing?

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *