Skip to content

Instantly share code, notes, and snippets.

@librasteve
Created February 16, 2026 18:24
Show Gist options
  • Select an option

  • Save librasteve/bb8e56357ba1fc395ffdc5c39dbe370c to your computer and use it in GitHub Desktop.

Select an option

Save librasteve/bb8e56357ba1fc395ffdc5c39dbe370c to your computer and use it in GitHub Desktop.
Copy Pasteable Tooltip
<style>
.tooltip {
position: relative;
display: inline-block;
}
.tooltip-content {
display: none;
position: absolute;
top: 120%;
left: 0;
background: #222;
color: white;
padding: 10px;
border-radius: 6px;
width: 250px;
user-select: text;
}
.tooltip-content.active {
display: block;
}
</style>
<div class="tooltip">
<button onclick="toggleTooltip()">Click me</button>
<div id="tip" class="tooltip-content">
You can highlight and copy this text safely.
</div>
</div>
<script>
function toggleTooltip() {
document.getElementById("tip").classList.toggle("active");
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment