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

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.

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

              
                <div class="cont">
    <div class="a"></div>
    <div class="b"></div>
</div>
<div class="cont">
    <div class="a"></div>
    <div class="b"></div>
</div>

<div class="cont">
    <div class="c"></div>
    <div class="d"></div>
</div>
<div class="cont">
    <div class="c"></div>
    <div class="d"></div>
</div>
              
            
!

CSS

              
                html
    background: #111
    height: 100%
    overflow: hidden

.cont
    position: absolute
    width: 40px
    height: 140px
    margin: auto
    animation: rotate 10s linear infinite
    top: 0
    left: 0
    bottom: 0
    right: 0

.cont:nth-child(2)
    animation: rotate 10s linear infinite
    animation-delay: -5s


.cont:nth-child(3)
    animation: rotate 10s linear infinite
    animation-delay: -2.5s


.cont:nth-child(4)
    animation: rotate 10s linear infinite
    animation-delay: -7.5s

.a, .b, .c, .d
    width: 40px
    height: 40px
    position: absolute

.a:after, .b:after, .c:after, .d:after
    display: block
    content: ''
    transform: scale(0.5)
    width: 40px
    height: 40px
    border-radius: 100%













.a
    animation: move 2s ease-in-out infinite alternate, zIndex 4s ease-in-out infinite

.b
    animation: move 2s ease-in-out infinite alternate-reverse, zIndex 4s ease-in-out infinite reverse

.a:after
    background: hsl(200, 80%, 70%)
    animation: zoom 2s ease-in-out infinite alternate
    animation-delay: -1s

.b:after
    background: hsl(260, 70%, 60%)
    animation: zoom 2s ease-in-out infinite alternate-reverse
    animation-delay: -1s









.c
    animation: move 2s ease-in-out infinite alternate, zIndex 4s ease-in-out infinite
    animation-delay: -1s, -1s

.d
    animation: move 2s ease-in-out infinite alternate-reverse, zIndex 4s ease-in-out infinite reverse
    animation-delay: -1s, -1s

.c:after
    background: hsl(0, 70%, 60%)
    animation: zoom 2s ease-in-out infinite alternate
    animation-delay: -2s

.d:after
    background: hsl(60, 80%, 70%)
    animation: zoom 2s ease-in-out infinite alternate-reverse
    animation-delay: -2s








@keyframes move
    100%
        transform: translateY(250%)

@keyframes zoom
    100%
        transform: scale(1)

@keyframes zIndex
    25%
        z-index: 1

    75%
        z-index: -1



@keyframes rotate
    to
        transform: rotateZ(360deg)

              
            
!

JS

              
                
              
            
!
999px

Console