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

              
                <link href="https://fonts.googleapis.com/css?family=Ubuntu:500" rel="stylesheet">


<div class="box pink">
  <h1>This is a </h1>
  Pink box
</div>

<div class="box white-stripes">
  <h1>Stripes</h1>
  Are cool too
</div>

<div class="box yellow-dots" style="max-width:440px;">
  <h1>This has dots</h1>
  <div class="box pink">
    Inspired by <a href="https://www.pinterest.com.au/pin/832884524814587842/">www.pinterest.com.au/pin/832884524814587842</a>
    <BR>
    <ul>
      <li>This</li>
        <li>is</li>
          <li>a</li>
            <li>list</li>
    </ul>
      <p>
        Did you notice that the text on the yellow background has a yellow outline, to distinguish it from the background? Text on the pink has a white drop shadow
      </p>
  </div>
</div>
  
  
<div class="box" style="max-width: 420px">
  <div class="yellow-dots inner under-bar">
    <h1>A title of sorts</h1>
  </div>
  <div class="white-stripes inner under-bar">
A billion years ago, I made a little game for the game jam Ludum Dare (Ludum Dare #23). A lot of my games are procedural, and just an exploration of a game mechanic but this was one of the few that had a story that had to be hand written. This was something I enjoyed, and planned to go back to someday. Flash-forward to today, and I’m remaking it for Android.  <BR>
    <div class="box pink">
  Imagine this is something else
</div>

    </div>
  <div class="pink inner">
    It’s not particularly pretty. There’s only one type of bracket, no objects, no arrays, no user-defined functions (yet) and IntelliJ obviously doesn’t have any idea of how to auto-format it. <a href="#">Do a thing &gt;</a>
  </div>
</div>
              
            
!

CSS

              
                $purple: #4a238f;
$yellow: #e4c110;
html,
body {
  background: linear-gradient(135deg, #8befd1 25%, transparent 25%) -5px 0,
    linear-gradient(225deg, #8befd1 25%, transparent 25%) -5px 0,
    linear-gradient(315deg, #8befd1 25%, transparent 25%),
    linear-gradient(45deg, #8befd1 25%, transparent 25%);
  background-size: 10px 10px;
  background-color: #acefd4;
  font-family: Ubuntu, sans-serif;
  line-height: 140%;
}

div.box {
  display: inline-block;
  border: 2px solid $purple;
  border-radius: 8px;
  font-weight: bold;
  color: $purple;
  vertical-align: top; 
  overflow: hidden;
}

.pink {
  background: #f091ef;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
  padding: 20px;
}

h1 {
  letter-spacing: 0.2rem;
  text-transform: uppercase;
  margin-top: 0;
}

.white-stripes {
  background-color: #f7f7f7;
  background-image: linear-gradient(transparent 50%, #d0e0e8 50%);
  background-size: 1px 6px;
  padding: 20px;
}

.yellow-dots {
  background-color: $yellow;
  background-image: radial-gradient($purple 15%, transparent 16%),
    radial-gradient($purple 15%, transparent 16%);
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
  text-shadow: 1px 0 $yellow, -1px 0 $yellow, 0 1px $yellow, 0 -1px $yellow;
  padding: 20px;
}

.box a {
  display: inline-block;
  color: $purple;
  background: white;
  transition: color 0.2s, background 0.2s;
  text-shadow: none;
  padding: 2px;
  font-style: italic;
  font-weight: normal;
  &:hover {
    color: white;
    background: $purple;
  }
}

.inner {
  margin: 0;
}

.under-bar {
  border-bottom: 2px solid $purple;
}
              
            
!

JS

              
                
              
            
!
999px

Console