The Divi Code Snippet module lets you display syntax highlighted source code within your Divi Builder pages. If you'd like to include a "Copy Code to Clipboard" button to allow users to quickly and easily copy your code samples, you can do it by setting:
Code Snippet Settings > Code Snippet > Copy-to-Clipboard Button = Yes
Like so:
You can optional also set the tooltip text displayed when the user hovers over the copy-to-clipboard button.
Here's how the copy button looks on the front-end (with hover tooltip shown):
Add Text Next to the Copy-to-Clipboard Button
If you'd like to add text next to the button, you can do so with some CSS like so:
.dbcs-clipboard-button:after {
content: 'Copy';
font-family: arial;
margin-left: 10px;
}
0 Comments