# markdown: Ensure code block copy button stays in the right spot \(\#26074\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/886d8c1cab48ba9d09e722f0245309505b2f0fc6)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 886d8c1cab48ba9d09e722f0245309505b2f0fc6

Requested commit: 886d8c1cab48ba9d09e722f0245309505b2f0fc6

Commit: 886d8c1cab48ba9d09e722f0245309505b2f0fc6

Tree: a80fc16ad273162780553fc4d273cd974a46ebb7

Author: Marshall Bowers

Committer: GitHub

## Message

```
markdown: Ensure code block copy button stays in the right spot (#26074)

This PR makes it so the copy button on Markdown code blocks stays
absolutely positioned even when scrolled:

<img width="1297" alt="Screenshot 2025-03-04 at 5 28 48 PM"
src="https://github.com/user-attachments/assets/b0d0fae9-ccd6-43c1-bef3-44d8d3c3e669"
/>

We achieve this by inserting a new parent element around both the copy
button and the code block itself so we can position the copy button
absolutely within that element.

Release Notes:

- N/A
```

## Parents

- [ebc5c213a29c1c6b9ed6f75517dc7a710318cd39](https://git.cafe/gitcafe/zed/commit/ebc5c213a29c1c6b9ed6f75517dc7a710318cd39?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/886d8c1cab48ba9d09e722f0245309505b2f0fc6?format=markdown)
