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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <p>点線:stroke-dasharray</p>
<svg x="0px" y="0px" width="395.9px" height="3" viewBox="0 0 395.9 1">
  <line class="line" x1="0" y1="0.5" x2="395.9" y2="0.5"/>
</svg>
<p>点の開始位置: stroke-dashoffset</p>
<svg x="0px" y="0px" width="395.9px" height="3" viewBox="0 0 395.9 1">
  <line class="line_d" x1="0" y1="0.5" x2="395.9" y2="0.5"/>
</svg>
<p>点の開始位置1: stroke-dashoffset</p>
<svg x="0px" y="0px" width="395.9px" height="3" viewBox="0 0 395.9 1">
  <line class="line1" x1="0" y1="0.5" x2="395.9" y2="0.5"/>
</svg>
<p>点の開始位置2: stroke-dashoffset</p>
<svg x="0px" y="0px" width="395.9px" height="3" viewBox="0 0 395.9 1">
  <line class="line2" x1="0" y1="0.5" x2="395.9" y2="0.5"/>
</svg>

<p>点線うごかす</p>
<svg x="0px" y="0px" width="395.9px" height="3" viewBox="0 0 395.9 1">
  <line class="line3" x1="0" y1="0.5" x2="395.9" y2="0.5"/>
</svg>
              
            
!

CSS

              
                svg line {
  fill: none;
  stroke: #09d;
  stroke-width: 3;
}
p{
  margin-top:30px;
}
.line {
   stroke-dasharray: 10;/*点線の長さ・間隔*/
}
.line_d {
   stroke-dasharray: 300;/*点線の間隔を空けてみる*/
}
.line1 {
   stroke-dasharray: 300;/*点線の間隔を空けてみる*/
   stroke-dashoffset: 300;/*点の開始位置*/
}
.line2{
   stroke-dasharray: 300;/*line1と同じ間隔*/
   stroke-dashoffset: 100;/*点の開始位置だけずれている*/
}
.line3 {
   stroke-dasharray: 300;/*点線の長さ・間隔*/
   stroke-dashoffset: 300;/*点の開始位置*/
  -webkit-animation: dash 8s linear 1s infinite;
  animation: dash 8s linear 1s infinite;/*一定に動かす*/
}
@-webkit-keyframes dash {
  to {
    stroke-dashoffset: 1000;
  }
  from{
    stroke-dashoffset: 0;
}
}
@keyframes dash {
  to {
    stroke-dashoffset: 1000;
  }
   from{
    stroke-dashoffset: 0;
}
}

              
            
!

JS

              
                
              
            
!
999px

Console