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

              
                <ol>
  <li>Ooops.</li>
  <li>The default list-position, outside, means the marker is outside the centered text box.</li>
  <li>That will make it look like the markers are left aligned.</li>
</ol>

<ol class="one">
  <li><br>If we kick the `list-style-position` inside, the numbers will be centered along with the text.</li>
  <li><br>Adding a literal &lt;br> element will put it up top (like we are aiming for).</li>
  <li><br>Having to use a special HTML element ain't great though.</li>
</ol>

<ol class="two">
  <li>Rather than use a default `list-style`, we can override it with `::marker`</li>
  <li>This means we can use whatever, text, unicode, emoji...</li>
  <li>Plus we can style it, at least a little.</li>
</ol>

<ol class="three">
  <li>But if we hard-code the `::marker`, we lose the numbering.</li>
  <li>We can get the numbering back by using counters.</li>
  <li>Here we've used that trick as well as the super weird line-break-in-pseudo-content trick.</li>
</ol>

<ol class="four">
  <li>`::marker` is somewhat new though.</li>
  <li>This is an example of using a `::before` pseudo element instead.</li>
  <li>It probably has slightly better browser support, and you don't need to weird white-space hack.</li>
</ol>
              
            
!

CSS

              
                ol,
ul {
  text-align: center;
  background: #eee;
  margin: 1rem;
  padding: 1rem;
  border: 1px solid #ccc;
}

.one {
  list-style-position: inside;
}

.two {
  list-style-position: inside;
  li::marker {
    white-space: pre-wrap;
    content: "❤\A";
    color: red;
    font-size: 125%;
    font-weight: bold;
  }
}

.three {
  counter-reset: ol;
  list-style-position: inside;
  li {
    counter-increment: ol;
    &::marker {
      white-space: pre-wrap;
      content: counter(ol) ". \A";
      color: orange;
      font-size: 200%;
    }
  }
}

.four {
  counter-reset: ol;
  list-style: none;
  li {
    counter-increment: ol;
    &::before {
      display: block;
      content: counter(ol) ".";
      color: orange;
      font-size: 200%;
    }
  }
}

body {
  margin: 0;
  font-family: system-ui;
}

              
            
!

JS

              
                
              
            
!
999px

Console