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

              
                <div class="container">
  
  <div class="box">
    <h3>Original Image</h3>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/234228/border-diamonds.png" alt="original image">
  </div>
  
  <div class="box box1">
    Border image with a border-image-repeat property set to stretch: diamond images are stretched on all 4 sides of the border.
  </div>
  <div class="box box2">
    Border image with a border-image-repeat property set to repeat: some diamond images are cut off.
  </div>
  <div class="box box3">
    Border image with a border-image-repeat property set to round: diamond images are evenly distributed.
  </div>
  <div class="box box4">
    Border image with a border-image-repeat property set to space: diamond images should be evenly spaced out.
  </div>
  <div class="box box5">
    Border image shorthand property
  </div>
</div>
              
            
!

CSS

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

img,
section,
article,
aside,
figure {
  display: block;
}

h3 {
  margin-bottom: 1.5em;
}

body {
  margin: 0;
  padding: 0;
  background-color: #eee;
  font-family: Verdana, Arial, sans-serif;
  font-size: 100%;
  font-weight: lighter;
  line-height: 1.5;
  color: #444;
}

.container {
  max-width: 90%;
  margin: 0 auto;
  background-color: #fff;
  padding: 0 2em;
}

.box {
  max-width: 60%;
  max-height: 60%;
  padding: 5%;
  margin: 2em auto;
}

.box1 {
  border: 19px dotted #c905c6;
  border-image-source: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/234228/border-diamonds.png);
  border-image-slice: 19;
  border-image-width: 19px;
}

.box2 {
  border: 19px dotted #c905c6;
  border-image-source: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/234228/border-diamonds.png);
  border-image-slice: 19;
  border-image-width: 19px;
  border-image-repeat: repeat;
}

.box3 {
  border: 19px dotted #c905c6;
  border-image-source: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/234228/border-diamonds.png);
  border-image-slice: 19;
  border-image-width: 19px;
  border-image-repeat: round;
}

.box4 {
  border: 19px dotted #c905c6;
  border-image-source: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/234228/border-diamonds.png);
  border-image-slice: 19;
  border-image-width: 19px;
  border-image-repeat: space;
}

.box5 {
  border-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/234228/border-diamonds.png) 19 / 19px / 0 round;
}
              
            
!

JS

              
                
              
            
!
999px

Console