Ad space

In-article ad

Ad space
eyJ2IjoxLCJiIjoiODk4NzUxMjU0MTU2NDk5MDUwIiwidyI6ImRlbW8iLCJ0IjoiMSJ9.JNwytzxn68dvLH1Z_gmjrF_npbIlkG_5lKkKaJtx68sNq6xmnGUZVOKYtYqT99no2gj0XcjwsZiev9GzFJK0OA

Head extras

Elegant Code Blocks in Centum: Formatted Snippets with an Instant Copy Button

If you write about programming or share code snippets with readers, plain text loses its formatting and is hard to copy. Centum code blocks show your snippets in a clean, dark, easy-on-the-eyes style with an instant copy button, so readers take the code with one click and no manual selecting.

What do you get?

Every code snippet in your post shows in a formatted box that keeps spaces and line breaks, with a "Copy" button that puts the whole snippet on the reader's clipboard and a small confirmation message after copying.

How to use it

Code blocks work automatically on any snippet placed between pre and code tags. In the Blogger editor:

1. Open your post and switch to "HTML view" from the toolbar.

2. Put the snippet between the two tags like this:

<pre><code>your snippet here</code></pre>

3. Save. The snippet appears in its styled box with the copy button.

Live example

body {
  direction: ltr;
  font-family: 'Inter', sans-serif;
}

What about site speed?

The styling is pure CSS and the copy button is a tiny script built into the theme: no heavy external syntax-highlighting libraries. If you want to turn the copy button off for any reason, the codeCopy setting in the ⚙ Theme settings gadget switches it off.

About the author

Ad space