Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>css-skewed-background</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            font-size: 62.5%;
        }

        body {
            min-height: 100vh;
            background: #222;
            display: grid;
            place-content: center;
            transform: perspective(800px);
            transform-style: preserve-3d;
        }

        .inner {
            display: block;
            margin: 0 auto;
            /* perspective: 100px; */
            transform-style: preserve-3d;
            transform-origin: center;
            transform: perspective(800px);
            border: 0px solid transparent;
            transition: transform .5s ease, border .5s ease;
        }

        .expand:has(input:not(:checked)) {
            color: #222;
        }

        body:has(.expand input:checked) .inner {
            transform: perspective(800px) skew(0deg, -10deg) rotateY(25deg) scale(.5) translateY(-50px) translateX(40px);
            border: 5px solid white;
            border-top: none;
            width: 80%;
        }

        body:has(.expand input:checked) .inner section:nth-child(1) {
            border-top: 5px solid white;
        }

        body:has(.expand input:checked) .inner section:nth-child(1)::before {
            transform: skew(0, -10deg);
        }

        .expand {
            position: absolute;
            top: 10px;
            right: 10px;
            font-size: 2em;
            font-family: Poppins;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
            z-index: 10;
            color: springgreen;
            transition: color .5s ease;
        }

        .expand input {
            appearance: none;
            width: 20px;
            aspect-ratio: 1;
            z-index: 1;
            cursor: pointer;
        }

        .expand::after {
            content: "";
            position: absolute;
            left: -2px;
            width: 20px;
            height: 20px;
            border-radius: 5px;
            border: 2px solid currentColor;
            background: radial-gradient(circle 5px, transparent 5px, transparent 6px);
            font-size: 1em;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            vertical-align: middle;
            pointer-events: none;
        }

        .expand:has(input:checked)::after {
            background: radial-gradient(circle 5px, currentColor 5px, transparent 6px);
        }

        section {
            position: relative;
            width: 100%;
            height: 300px;
            font-family: Poppins;
            font-size: 1em;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: center;
            gap: 15px;
            padding: 2em;
        }

        section h1 {
            font-size: 4em;
            font-weight: 700;
            color: #222;
        }

        section p {
            font-size: 1.2em;
        }

        section:nth-child(2) {
            align-items: flex-end;
            color: #fff;
        }

        section:nth-child(2) h1 {
            color: springgreen;
        }

        section:nth-child(1) {
            /* background: springgreen; */
        }

        section:nth-child(1)::before {
            content: "";
            position: absolute;
            inset: 0;
            top: -50%;
            height: 150%;
            background-color: springgreen;
            z-index: -1;
            transform: skew(0deg, -10deg);
            box-shadow: 0 -50px 100px 50px transparent;
        }

        section:nth-child(1):hover::before {
            box-shadow: 0 -50px 100px 50px springgreen;
        }


        @media screen and (max-width:576px) {
            html {
                font-size: 50%;
            }
        }
    </style>
</head>

<body>
    <div class="expand">
        <input type="checkbox" name="expand">
        <label for="expand">Expand</label>
    </div>
    <div class="inner">
        <section>
            <h1>Gorithm is here</h1>
            <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore, quae! Voluptate esse placeat aperiam
                eos
                iusto tempore quaerat doloremque et voluptates commodi maiores consequatur corporis dolore sequi modi
                quas,
                pariatur tempora illum. In consequuntur distinctio recusandae labore, vitae consectetur sequi molestias
                illum tempore a possimus quod nihil. Adipisci, ducimus placeat.</p>

        </section>
        <section>
            <h1>Gorithm is here again</h1>
            <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore, quae! Voluptate esse placeat aperiam
                eos
                iusto tempore quaerat doloremque et voluptates commodi maiores consequatur corporis dolore sequi modi
                quas,
                pariatur tempora illum. In consequuntur distinctio recusandae labore, vitae consectetur sequi molestias
                illum tempore a possimus quod nihil. Adipisci, ducimus placeat.</p>
        </section>
    </div>
</body>

</html>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console