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

              
                <main>
  <section>
    <h1>Main title</h1>
    <p>Dragée powder bear claw tiramisu pudding gummi bears wafer. Macaroon chocolate cake cake marzipan icing carrot cake macaroon sweet. Lemon drops </p>
  </section>
  <section class="full-bleed-1">
    <h2>Full bleed (no margin)</h2>
    <p> cotton candy bear claw. Dessert danish pastry tootsie roll biscuit jujubes lollipop pastry tootsie roll.  </p>
  </section>
  <section class="full-bleed-2">
    <h2>Full bleed (margin on big screens)</h2>
    <p> cotton candy bear claw. Dessert danish pastry tootsie roll biscuit jujubes lollipop pastry tootsie roll.  </p>
  </section>
  <section class="full-bleed-3">
    <h2>Full bleed (margin on small screens)</h2>
    <p> cotton candy bear claw. Dessert danish pastry tootsie roll biscuit jujubes lollipop pastry tootsie roll.  </p>
  </section>
  <section class="full-bleed-4">
    <h2>Full bleed (always a margin)</h2>
    <p> cotton candy bear claw. Dessert danish pastry tootsie roll biscuit jujubes lollipop pastry tootsie roll.  </p>
  </section>
  <section>
    <h2>lemon drops candy</h2>
    <p>Dessert halvah sesame snaps jelly beans caramels marzipan. Cheesecake ice cream gummies lemon drops candy chocolate bar dessert pie. Tootsie roll gummi bears biscuit marshmallow sweet halvah fruitcake marzipan. Candy canes cake gummies marzipan marshmallow lollipop. Lemon drops apple pie tootsie roll pastry apple pie jelly-o. Biscuit lollipop biscuit muffin carrot cak</p>
  </section>
  <section>
    <h3>full bleed image</h3>
    <div class="full-bleed-2" >
      <img src="https://picsum.photos/id/115/1000/300">
    </div>
  </section>
  <section>
    <h3>Cake pie lollipop</h3>
    <p>Jelly chocolate biscuit sesame snaps dessert chocolate. Topping jelly-o jelly jujubes marzipan sugar plum. Cake pie lollipop halvah shortbread. Powder tiramisu tart wafer marshmallow gingerbread powder</p>
  </section>
</main>
              
            
!

CSS

              
                html {
  container-type: inline-size;
}

main {
  --w: 600px; /* the max width*/
  --m: 1em;   /* minimum margin */
  
  margin-inline: max(   var(--m),(100cqw - var(--w))/2);
}
.full-bleed-1 {
  margin-inline: min(-1*var(--m),(var(--w) - 100cqw)/2);
}
.full-bleed-2 {
  margin-inline: min(-1*var(--m),(var(--w) - 100cqw)/2 + var(--m));
}
.full-bleed-3 {
  margin-inline: min(        0px,(var(--w) - 100cqw)/2);
}
.full-bleed-4 {
  margin-inline: min(        0px,(var(--w) - 100cqw)/2 + var(--m));
}



section[class*="full-bleed"] {
  padding-inline: var(--m);
  margin-block: var(--m);
  background: pink;
}
section {
  padding-block: .3em;
}

body {
  font-family: system-ui, sans-serif;
  background: #eee;
  margin: 0;
}
h1 {
  font-size: 3rem;
}
p {
  font-size: 1.5rem;
  text-align:justify;
}
img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}
              
            
!

JS

              
                
              
            
!
999px

Console