cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

              // CodePen Hack script to show pens directly in the gallery without leaving the page

let previewWrapper;
let previewIframe;
let coverLinks;

document.body.innerHTML += `<div id="preview-wrapper" style="position:fixed;z-index:200;display:none;top:0;left:0;width:100%;height:100%">
        <iframe id="preview-iframe" name="preview-iframe" src="" style="position:absolute;top:50%;left:50%;height:calc(100% - 4rem);width:calc(100% - 4rem);transform:translate(-50%,-50%);border:0;box-shadow:0 .5rem 2rem rgba(0,0,0,.5);background:#fff"></iframe>

function enableSamePageGallery() {

    previewWrapper = document.getElementById("preview-wrapper");
    previewIframe = document.getElementById("preview-iframe");
    coverLinks = document.querySelectorAll(".cover-link");

    coverLinks.forEach(coverLink => {
        let splitted = coverLink.getAttribute("href").split("/");
        splitted[4] = "full";
        coverLink.setAttribute("href", splitted.join("/"));
        coverLink.setAttribute("target", "preview-iframe");

        coverLink.addEventListener("click", () => {
            previewWrapper.style.display = "block";

    previewWrapper.addEventListener("click", () => {
        previewWrapper.style.display = "none";
        previewIframe.src = "";

    document.querySelectorAll(".pagination-button").forEach(btn => {
        btn.addEventListener("click", () => {
            setTimeout(enableSamePageGallery, 1500);

Loading ..................