Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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.


Auto Save

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.


                <button popovertarget="my-tooltip">
  <svg xmlns="" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" aria-hidden="true">
    <path stroke-linecap="round" stroke-linejoin="round" d="m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z" />
  <span class="sr-only">Toggle tooltip</span>
<!-- for demo reasons, the popover is set to manual :) feel free to change it to auto if you want to light dismiss it -->
<div id="my-tooltip" popover="manual">Look at the cute little popover</div>

<fieldset class="controls">
  <legend>Position icon:</legend>
  <div class="grid">
    <label><input type="radio" name="position" class="top left" /><span class="sr-only">top left</span></label>
    <label><input type="radio" name="position" class="top center" /><span class="sr-only">top center</span></label>
    <label><input type="radio" name="position" class="top right" /><span class="sr-only">top righ</span></label>
    <label><input type="radio" name="position" class="left" /><span class="sr-only">left</span></label>
    <label><input type="radio" name="position" class="center" checked /><span class="sr-only">center</span></label>
    <label><input type="radio" name="position" class="right" /><span class="sr-only">right</span></label>
    <label><input type="radio" name="position" class="bottom left" /><span class="sr-only">bottom left</span></label>
    <label><input type="radio" name="position" class="bottom center" /><span class="sr-only">bottom center</span></label>
    <label><input type="radio" name="position" class="bottom right" /><span class="sr-only">bottom right</span></label>


                /* For this anchoring to work, reset the margin of the popover and display the anchor (button in this case) as a grid */

[popover] {
  inset: unset;
  background: hotpink;
  color: white;
  border-radius: 0.5rem;
  border: 0;
  padding: 1rem;
  margin: 0.5rem;
  /* position */
  position-anchor: --button;
  inset-area: top;
  position-try-options: flip-inline, flip-block, flip-block flip-inline;
  position-try-order: most-width;

button {
  all: unset;
  anchor-name: --button;
  transition: color 0.4s ease-out;
  &:is(:hover, :focus) {
    color: hotpink;

svg {
  width: 3rem;
  aspect-ratio: 1;

body {
  display: flex;
  flex-direction: column;
  align-items: var(--align, center);
  justify-content: var(--justify, center);
  min-height: 100dvh;
  margin: 0;
  font-family: sans-serif;
  font-size: 1.16rem;
  line-height: 1.6;
  color: #fff;
  background: #2b2c28;

@layer controls {
  .controls {
    position: fixed;
    bottom: 20vh;
    margin: 0;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25rem;

  .grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-items: center;

  input {
    width: 1.5rem;
    aspect-ratio: 1;
    margin: 0;
    padding: 0;

  input[type="radio"] {
    accent-color: deeppink;
    cursor: pointer;

  body:has(.left:checked) {
    --align: start;

  body:has(.right:checked) {
    --align: end;

  body:has(.center:checked) {
    --justify: center;

  body:has(.top:checked) {
    --justify: start;

  body:has(.bottom:checked) {
    --justify: end;

  .sr-only {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;