Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <figure class="verdon">
  <img src="https://assets.codepen.io/15542/GwenVerdon.jpg" alt="Gwen Verdon on a stool">
  <figcaption>
    <strong><a href="#">Gwyneth Evelyn "Gwen" Verdon</a></strong>
    (January 13, 1925 – October 18, 2000)
    was an American <a href="#">actress</a> and <a href="#">dancer</a>.
    She won four Tony Awards for her musical comedy performances,
    and served as an uncredited choreographer's assistant
    and <a href="#">specialty dance coach for theater and film</a>.
  </figcaption>
</figure>

<figure class="fosse">
  <img src="https://assets.codepen.io/15542/BobFosse.jpg" alt="Bob Fosse doing jazz hands">
  <figcaption>
    <strong><a href="#">Bob Fosse</a></strong>
    (June 23, 1927 – September 23, 1987)
    was an American dancer, musical-theatre choreographer,
    and theatre and film director.
    He directed and choreographed musical works on stage and screen,
    including the stage musicals The Pajama Game (choreography)
    in 1954 and Chicago in 1975 and the film Cabaret in 1972.
  </figcaption>
</figure>

<figure class="verdon">
  <img src="https://assets.codepen.io/15542/GwenVerdon.jpg" alt="Gwen Verdon on a stool">
  <figcaption>
    <strong><a href="#">Gwyneth Evelyn "Gwen" Verdon</a></strong>
    (January 13, 1925 – October 18, 2000)
    was an American <a href="#">actress</a> and <a href="#">dancer</a>.
    She won four Tony Awards for her musical comedy performances,
    and served as an uncredited choreographer's assistant
    and <a href="#">specialty dance coach for theater and film</a>.
  </figcaption>
</figure>

<figure class="fosse">
  <img src="https://assets.codepen.io/15542/BobFosse.jpg" alt="Bob Fosse doing jazz hands">
  <figcaption>
    <strong><a href="#">Bob Fosse</a></strong>
    (June 23, 1927 – September 23, 1987)
    was an American dancer, musical-theatre choreographer,
    and theatre and film director.
    He directed and choreographed musical works on stage and screen,
    including the stage musicals The Pajama Game (choreography)
    in 1954 and Chicago in 1975 and the film Cabaret in 1972.
  </figcaption>
</figure>

              
            
!

CSS

              
                img {
  float: var(--float, left);
  margin-inline: var(--img-space, 0 var(--gap));
  width: clamp(150px, 33%, 400px);
  
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  shape-outside: polygon(0 0, 100% 0, 100% 100%, 0 100%);

  figure:nth-child(even) & {
    --float: right;
    --img-space: var(--gap) 0;
  }
}

a:any-link {
  text-decoration-color: hotPink;
  text-decoration-thickness: 0.05em;
  text-underline-offset: 0.1em;
  transition: text-decoration 300ms ease-in-out;
}

a:focus,
a:hover,
a:active {
  text-decoration-thickness: 0.2em;
}

main {
  /* scroll-snap-type: y; */
  /* scroll-padding: 1em; */
}

figure {
  /* scroll-snap-align: start; */
  /* scroll-margin: 1em; */
  
  &:has(:focus) { 
    border-color: teal; 
    border-style: dashed; 
  }
}

@layer reset, base;

@layer base {
  html {
    --pink: #B6236C;
    --blue: #205769;
  }
  
  body {    
    --text-small: clamp(0.938rem, 0.824rem + 0.568cqi, 1.25rem);
    --text-normal: clamp(1.25rem, 1.023rem + 1.136cqi, 1.875rem);
    --text-large: clamp(1.35rem, 0.818rem + 2.659cqi, 2.813rem);
    --text-xlarge: clamp(1.7rem, 0.784rem + 4.58cqi, 4.219rem);
    --gap: clamp(2cqi, 0.5lh, 5cqi);
    font-size: var(--text-normal);
    padding: var(--gap);
  }
  
  figure {
    align-content: start;
    background-color: #f6f6f6;
    border: medium solid maroon;
    display: flow-root;
  }

  figcaption {
    padding: var(--gap);
  }
}

@layer reset {
  * { box-sizing: border-box; }
  html { block-size: 100%; }
  
  body {
    margin: unset;
    min-block-size: 100%;
  }  
  
  picture { display: contents; }
  img { display: block; }

  img,
  svg {
    max-inline-size: 100%;
  }
    
  input,
  button,
  textarea,
  select {
    font: inherit;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console