Pen Settings

HTML

CSS

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.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Details

Privacy

Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO

Behavior

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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

Template

Make Template?

Templates are Pens that can be used to start other Pens. You can view all of your templates, or learn more in the documentation.

Screenshot

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

Uploading

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <div id="page-container">
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate01">

                    </div>
                    <!-- animate01 end -->
                </div>
                <!-- original end -->
                <div class="text-box">
                    <pre>
@keyframes demo {
        from {width: 100px;}
        to {width: 500px;}
    }</pre>
                </div>
            </div>
            <!-- example-box end -->

        </div>
        <!-- example-container end -->
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate02">

                    </div>
                    <!-- animate02 end -->
                </div>
                <!-- original end -->
                <div class="text-box">
                    <pre>
@keyframes demo {
    0% {width: 0px;}
    25% {width: 100px;}
    50% {width: 200px;}
    75% {width: 300px;}
    100% {width: 400px;}
}
</pre>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate03">

                    </div>
                    <!-- animate03 end -->
                </div>
                <!-- original end -->
                <div class="text-box">
                    <pre>
@keyframes demo {
    from {top: 25px;
          left: 25px;
          background-color: navy;}
    to {top: 25px;
        left: 300px;
        background-color: orangered;}
}
</pre>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate04">

                    </div>
                    <!-- animate04 end -->
                </div>
                <!-- original end -->
                <div class="text-box">Wie oben, aber mit
                    <br/>
                    <em>animation-fill-mode: forwards;</em>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->

        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate05">

                    </div>
                    <!-- animate05 end -->
                </div>
                <!-- original end -->
                <div class="text-box">Wie oben, aber mit
                    <br/>
                    <em>animation-delay: 800ms;</em>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate06">

                    </div>
                    <!-- animate06 end -->
                </div>
                <!-- original end -->
                <div class="text-box">
                    Wie oben, aber mit
                    <br/>
                    <em>animation-timing-function: linear;</em>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate07">

                    </div>
                    <!-- animate07 end -->
                </div>
                <!-- original end -->
                <div class="text-box">
                    Wie oben, aber mit
                    <br/>
                    <em>animation-direction: reverse;</em>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->
        <div id="example-container">
            <div class="example-box">
                <div class="original">
                    <div id="animate08">

                    </div>
                    <!-- animate08 end -->
                </div>
                <!-- original end -->
                <div class="text-box">
                    Wie oben, aber mit<br/>
                    <em>animation-direction: alternate;</em> und
                    <em>animation-iteration-count: infinite;</em>
                </div>
            </div>
            <!-- example-box end -->
        </div>
        <!-- example-container end -->

    </div>
    <!-- page-container end -->
            
          
!

CSS

            
              * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        em {
            font-family: Consolas, monospace;
            background-color: lightgray;
            padding: 1px;
        }

        #page-container {
            padding: 100px;
            font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
            font-size: 18px;
        }

        #example-container {
            width: 90%;
            margin: 0 auto;
        }

        .text-box {
            font-family: Consolas, monospace;
            width: 35%;
        }

        .example-box {
            margin: 0 auto;
            padding: 50px;
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            border-bottom: 2px solid aliceblue;
        }

        [id^="animate"] {
            position: absolute;
            width: 150px;
            height: 150px;
            background-color: navy;
            padding: 0 5px;
        }

        .original {
            position: relative;
            width: 150px;
            height: 150px;
            background-color: orangered;
        }

        /* Animation 01: Rechteck wird breiter mit from-to */

        #animate01 {
            width: 100px;
            height: 100px;

            animation-name: demo01;
            animation-duration: 2s;
        }

        @keyframes demo01 {
            from {
                width: 100px;
            }
            to {
                width: 500px;
            }
        }

        /* Animation 02: Rechteck wird breiter in 25%-Schritten */

        #animate02 {
            width: 0px;
            height: 100px;
            padding: 0;

            animation-name: demo02;
            animation-duration: 4s;
        }

        @keyframes demo02 {
            0% {
                width: 0px;
            }
            25% {
                width: 100px;
            }
            50% {
                width: 200px;
            }
            75% {
                width: 300px;
            }
            100% {
                width: 400px;
            }
        }

        /* Animation 03: Kugel rollt nach rechts, springt in Ausgangsposition zurück */

        #animate03 {
            width: 100px;
            height: 100px;
            padding: 0;
            top: 25px;
            left: 25px;
            border-radius: 50%;

            animation-name: demo03;
            animation-duration: 4s;
        }

        @keyframes demo03 {
            from {
                top: 25px;
                left: 25px;
                background-color: navy;
            }
            to {
                top: 25px;
                left: 300px;
                background-color: orangered;
            }
        }

        /* Animation 04: Kugel bleibt rechts liegen */

        #animate04 {
            width: 100px;
            height: 100px;
            padding: 0;

            left: 25px;
            border-radius: 50%;

            animation-name: demo04;
            animation-duration: 4s;

            animation-fill-mode: forwards;
        }

        @keyframes demo04 {
            from {
                top: 25px;
                left: 25px;
                background-color: navy;
            }
            to {
                top: 25px;
                left: 300px;
                background-color: orangered;
            }
        }

        /* Animation 05: Start verzögert mit animation-delay */

        #animate05 {
            width: 100px;
            height: 100px;
            padding: 0;
            top: 25px;
            left: 25px;
            border-radius: 50%;

            animation-name: demo05;
            animation-duration: 4s;

            animation-fill-mode: forwards;

            animation-delay: 800ms;
        }

        @keyframes demo05 {
            from {
                top: 25px;
                left: 25px;
                background-color: navy;
            }
            to {
                top: 25px;
                left: 300px;
                background-color: orangered;
            }
        }

        /* Animation 06: animation-timing-function: linear
           gleichmäßige Geschwindigkeit der Animation */

        #animate06 {
            width: 100px;
            height: 100px;
            padding: 0;
            top: 25px;
            left: 25px;
            border-radius: 50%;

            animation-name: demo06;
            animation-duration: 4s;

            animation-fill-mode: forwards;

            animation-delay: 800ms;

            animation-timing-function: linear;
        }

        @keyframes demo06 {
            from {
                top: 25px;
                left: 25px;
                background-color: navy;
            }
            to {
                top: 25px;
                left: 300px;
                background-color: orangered;
            }
        }

        /* Animation 07: Animation rückwärts abspielen */

        #animate07 {
            width: 100px;
            height: 100px;
            padding: 0;
            top: 25px;
            left: 25px;
            border-radius: 50%;

            animation-name: demo07;
            animation-duration: 4s;

            /* animation-fill-mode: forwards; */
            animation-delay: 800ms;

            animation-timing-function: linear;

            animation-direction: reverse;
        }

        @keyframes demo07 {
            from {
                top: 25px;
                left: 25px;
                background-color: navy;
            }
            to {
                top: 25px;
                left: 300px;
                background-color: orangered;
            }
        }

        /* Animation 07: Animation rückwärts abspielen */

        #animate08 {
            width: 100px;
            height: 100px;
            padding: 0;
            top: 25px;
            left: 25px;
            border-radius: 50%;

            animation-name: demo08;
            animation-duration: 4s;

            /* animation-fill-mode: forwards; */
            animation-delay: 800ms;

            animation-timing-function: linear;

            animation-direction: alternate;

            animation-iteration-count: infinite;
        }

        @keyframes demo08 {
            from {
                top: 25px;
                left: 25px;
                background-color: navy;
            }
            to {
                top: 25px;
                left: 300px;
                background-color: orangered;
            }
        }
            
          
!

JS

            
              
            
          
!
999px

Console