<div class="code-wrapper">
<div class="code-header">
<span class="lang-label">CSS</span>
<button class="copy-code-btn">Copy</button>
</div>
<pre><code id="codeSource">.element {
display: flex;
justify-content: center;
color: #3b82f6;
}</code></pre>
</div>.code-wrapper {
font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
background: #1e293b;
border-radius: 12px;
overflow: hidden;
max-width: 500px;
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.code-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 20px;
background: #0f172a;
border-bottom: 1px solid #334155;
}
.lang-label {
color: #94a3b8;
font-size: 0.85rem;
font-weight: 600;
}
.copy-code-btn {
background: #334155;
border: none;
color: #fff;
padding: 6px 12px;
border-radius: 6px;
font-size: 0.8rem;
cursor: pointer;
transition: background 0.2s;
}
.copy-code-btn:hover {
background: #475569;
}
pre {
margin: 0;
padding: 20px;
overflow-x: auto;
}
code {
font-family: monospace;
color: #e2e8f0;
font-size: 0.9rem;
line-height: 1.5;
}const copyCodeBtn = document.querySelector(".copy-code-btn");
const codeSource = document.getElementById("codeSource");
copyCodeBtn.addEventListener("click", () => {
navigator.clipboard.writeText(codeSource.innerText).then(() => {
const originalText = copyCodeBtn.innerText;
copyCodeBtn.innerText = "Copied!";
setTimeout(() => {
copyCodeBtn.innerText = originalText;
}, 2000);
});
});Nothing to show yetType HTML, CSS or JavaScript and your page appears here.
Click any element to find its code Esc
Check this code before you run it
It came from a shared link. It runs with fewer permissions, so it cannot open pop-ups, submit forms or start downloads.
0.00s / 0.00s
Nothing has animated yet. Hover, click or type in the preview and each CSS animation, transition or
element.animate() call shows up here as it plays.