Beispiel:CSS user-select.html
Aus SELFHTML-Wiki
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>user-select</title>
<style>
.no-copy {
cursor: not-allowed;
-webkit-user-select: none; /* ältere Chrome + Safari */
user-select: none;
}
.all-copy {
cursor: copy;
-webkit-user-select: all; /* ältere Chrome + Safari */
user-select: all;
padding: 1em;
}
.all-copy span {margin-left: 0.3em;}
.all-copy::selection,
.all-copy span::selection {
color: white;
background-color: green;
margin-left: 0;
}
</style>
</head>
<body>
<h1>user-select</h1>
<p class="no-copy">Dieser Satz ist kopiergeschützt - wenn Sie das CSS im Frickl oder den Entwicklerwerkzeugen ändern natürlich nicht mehr!</p>
<dl>
<dt>IBAN</dt>
<dd class="all-copy">DE<span>12</span><span>1234</span><span>5678</span><span>0000</span><span>1234</span><span>89</span></dd>
</dl>
<p>Klicken Sie auf die IBAN ,um sie zu kopieren.</p>
</body>
</html>