Pen Settings



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


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


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.


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.


                <div class="container">
  <p class="intro">
    The initial value set on the <code>background-size</code> property is <code>auto</code>, which is the default value.
  <div class="element element-1">My background origin has the default padding-box value. The background's position origin is at the padding box's top left corner.
  <div class="controls">
    <label for="radio-1">
      <input checked type="radio" id="radio-1" name="bsize" onchange="if(this.checked) document.querySelector('.element-1').style.backgroundOrigin='padding-box';" />
      <span>Padding Box</span>
    <label for="radio-2">
      <input type="radio" id="radio-2" name="bsize" onchange="if(this.checked) document.querySelector('.element-1').style.backgroundOrigin='border-box';" />
      <span>Border Box</span>
    <label for="radio-3">
      <input type="radio" id="radio-3" name="bsize" onchange="if(this.checked) document.querySelector('.element-1').style.backgroundOrigin='content-box';" />
      <span>Content Box</span>
  <p class="credits">Image from <a href="">Unsplash</a></p>


                * { 
    box-sizing: border-box; 
    -moz-box-sizing: border-box; 

body {
    background-color: #F5F5F5;
    color: #555;
    font-size: 1.1em;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  font-size: 14px;

  color: green;
  background: #e1e1e1;
  padding: 2px 5px;
  display: inline-block;
  border-radius: 3px;

.container {
    padding: 20px;

.controls {
    padding: 20px 0;

.controls label {
    font-weight: bold;
    display: inline-block;
    margin-right: 10px;
  margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    font-size: 75%;
    background: #a5ad1f;
    padding: 5px 10px 5px 5px;
    cursor: pointer;
  border-radius: 3px;

.controls label input {
    vertical-align: top;

.controls label span {
    vertical-align: middle;

.element {
  padding: 40px;
  margin-bottom: 30px;
  background-color: #0099cc;
  color: white;
  border: 30px solid rgba(233, 19, 140, 0.5);
  background-image: url(;
  height: 300px;
  background-repeat: no-repeat;

  font-size: 12px;
  color: #999;

.credits a{
  color: black;
  text-decoration: none;

  width: 100%;
  height: 500px;
  padding: 30px;
  border: 30px solid rgba(red, 0.3);
  background:  url( no-repeat 30% 10% / 100px 100px, 
    url( no-repeat 50% 50% / 100px 100px padding-box padding-box red;