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 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

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 id="svg">
<svg
   viewBox="0 0 14.552103 14.552094"
   id="square">
  <defs
     id="defs4570">
    <marker
       style="overflow:visible"
       id="Arrow1Mstart"
       refX="0.0"
       refY="0.0"
       orient="auto">
      <path
         transform="scale(0.4) translate(10,0)"
         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
         id="path4587" />
    </marker>
    <marker
       style="overflow:visible;"
       id="Arrow1Lend"
       refX="0.0"
       refY="0.0"
       orient="auto">
      <path
         transform="scale(0.8) rotate(180) translate(12.5,0)"
         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;"
         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
         id="path4584" />
    </marker>
    <marker
       style="overflow:visible"
       id="Arrow1Lstart"
       refX="0.0"
       refY="0.0"
       orient="auto">
      <path
         transform="scale(0.8) translate(12.5,0)"
         style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt"
         d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
         id="path4581" />
    </marker>
  </defs>
  <metadata
     id="metadata4573">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     id="lines"
     transform="translate(-112.44791,-152.80207)">
    <rect
       style="stroke-width:0.26499999;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none"
       id="top"
       width="14.552083"
       height="1.3229166"
       x="112.44791"
       y="152.80209" />
    <rect
       style="stroke-width:0.26499999;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none"
       id="right"
       width="14.552083"
       height="1.3229166"
       x="152.80208"
       y="-127.00001"
       transform="rotate(90)" />
    <rect
       style="stroke-width:0.26499999;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none"
       id="left"
       width="14.552083"
       height="1.3229166"
       x="-167.35416"
       y="112.44793"
       transform="rotate(-90)" />
    <rect
       style="stroke-width:0.26499999;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none"
       id="bottom"
       width="14.552083"
       height="1.3229166"
       x="-126.99999"
       y="-167.35417"
       transform="scale(-1)" />
  </g>
  <rect
     y="1.2977492"
     x="1.2977492"
     height="11.956595"
     width="4.2912235"
     id="sidebar"
     style="stroke-width:0;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;fill:#da6067;fill-opacity:1;stroke:#000000;stroke-opacity:1" />
  <rect
     transform="scale(-1)"
     y="-13.254345"
     x="-13.219737"
     height="5.0179644"
     width="7.6307645"
     id="content"
     style="fill:#dad967;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</svg>
</div>
              
            
!

CSS

              
                $duration = 2s

#svg
  position: relative
  width: 300px
  height: 300px
  margin: 100px auto

#top
  animation: showTop $duration linear infinite
  animation-direction: alternate
  
@keyframes showTop {
  0% {width:0%;}
  10%,100% {width: 100%}
}


#right
  animation: showRight $duration linear infinite
  animation-direction: alternate
  
@keyframes showRight {
  0%, 10.01% {width:0%;}
  20%,100% {width: 100%}
}

#bottom
  animation: showBottom $duration linear infinite
  animation-direction: alternate
  
@keyframes showBottom {
  0%, 20.01% {width:0%;}
  30%,100% {width: 100%}
}

#left
  animation: showLeft $duration linear infinite
  animation-direction: alternate
  
@keyframes showLeft {
  0%, 30.01% {width:0%;}
  40%,100% {width: 100%}
}

#sidebar
  animation: showSidebar $duration ease-in infinite
  animation-direction: alternate
  
@keyframes showSidebar {
  0%, 50% {width:0%;}
  70%,100% {width: 29.5%}
}

#content
  animation: showContent $duration ease-out infinite
  animation-direction: alternate
  
@keyframes showContent {
  0%, 70.01% {height:0%;}
  80%,100% {height: 30%}
}
              
            
!

JS

              
                
              
            
!
999px

Console