Copy code button (client side)
The copy button is added in the browser
Here is a CSS code block sporting a copy button.
some-box {
width: 20px;
height: 20px;
background: black;
margin-bottom: 1.5rem;
}
Here lies a HTML code block that overflows, the sticky button ensures the button is always visible.
<div>long text to show overflow and how you want to handle it</div>
Here lies a pre block that does not contain a code element. You can see it does not have a copy button, as expected! Huzzah!
This is a pre block without code.