swaka
August 22, 2025, 2:43pm
62
I like this! But is there any way to make the βcopy codeβ button float above/anchor to the top right of the view, instead of getting dragged to the left as you scroll? See below:
+1. it is really important for me.
you can use the css snippet to solve the problem:
.markdown-rendered :not(.print) code,
body :not(.print) code {
word-break: normal;
overflow-wrap: normal;
white-space: pre;
}
.el-pre {
position: relative;
}
.el-pre pre {
overflow-x: auto;
position: static;
}
.markdown-rendered button.copy-code-button {
background-color: var(--code-background);
border: 1px solid var(--code-border-color);
cursor: pointer;
transition: background-color 0.2s ease, border-color 0.2s ease;
}
.theme-light .markdown-rendered button.copy-code-button:hover {
background-color: rgba(0, 0, 0, 0.03);
border-color: rgba(0, 0, 0, 0.12);
}
.theme-dark .markdown-rendered button.copy-code-button:hover {
background-color: rgba(255, 255, 255, 0.08);
border-color: rgba(255, 255, 255, 0.15);
}
Zeff
February 6, 2026, 3:59pm
67
Here we are 4 years later and itβs still not solved!
One of many Obsidian βMarie Antoinetteβ moments: βLet them eat cake.β