Designing a short story site has its challenges.
One story may require hidden text to show up when copied and pasted.
Is there a way to achieve this effect using only HTML and CSS without relying on Javascript?
Here is an example of the HTML code:
<div>Lorem ipsum <span class="inv"> ---- Cleverly hidden text here ---- </span>dolor sit amet</div>
I have tried different styles, such as setting display: none;
, but that does not copy the hidden text as intended.
width: 1px;
overflow: hidden;
display: inline-block;
height: 1em;
color: rgba(255,255,255,0);
Changing the width to 0;
prevents the text from being copied. The current style still shows a slight artifact when highlighted.
(On a side note: It seems like the goal is for the story to subtly hint at revealing hidden information when copied, leading users to discover another unlisted story on the site)