This is the easy way to add the copy button on the page.
Note: Prefer this option, if you have multiple pages, and want to add the copy button to all those elements. E.g. You have a code block on multiple pages then you can use this easy method.
In this documentation, we are going to see how to add the copy button with the CSS ID selector.
Before adding the copy button with the CSS class selector, we need the sample demo page.
We have created the demo page with dummy content.
See the demo content and the dummy page
Great, After creating the demo page, or, checking how the demo page content looks like, let’s see how to use the CSS ID as a selector to add the copy button.
Top ↑In this example, we are going to add the copy button to the Preformatted Block from the demo page.
If you don’t see the sidebar, then check the below example of other demo for your reference:
Top ↑To add the copy button with the CSS ID selector, do it as:
You’ll see the add new screen something as below:
We are going to add the text as:
Great! We just have added the copy button to all those elements where the demo-id exists as the ID selector.
Top ↑Just refresh the page, and you can see the Copy Code button added to the Preformatted from the demo page.
See the below video for reference:
Top ↑Alternatively, You can use the below selectors as well:
Top ↑We are going to add the copy button to the Blockquote Block from the demo page.
SeeĀ Add the copy button with the CSS class selector.
Top ↑We are going to add the copy button to the List Block from the demo page.
See Add the copy button with the HTML tag selector.
Join Thousands of Satisfied Customers
Supercharge your content today!