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

              
                <body>
  <div class="wrapper">

    <header class="landmark">
      <a href="#" class="logo">
        Biscuit!
      </a>
      <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
        <circle cx="50" cy="50" r="50" />
      </svg>
    </header>

    <main class="landmark">
      <div class="placeholder">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
      </div>

      <article class="chocolate">
        <h2>Choco cake</h2>
        <p>Cookie tart cake cotton candy chocolate chocolate.</p>
        <section>
          <h3>Jelly beans</h3>
          <p>
            Jelly beans gummi bears halvah halvah croissant lemon drops donut gummi bears
            candy canes. Icing sugar plum chupa chups jelly-o soufflé jelly-o pudding
            lollipop. Chocolate bar muffin bonbon pie tootsie roll danish bear claw
            cheesecake.
          </p>
        </section>
        <section>
          <h3>Marzipan</h3>
          <p>
            Marzipan bear claw sweet marzipan tootsie roll. Chupa chups powder tart halvah gingerbread icing sweet.
          </p>
        </section>
        <section>
          <h3>Cheesecake</h3>
          <p>
            Powder halvah soufflé caramels soufflé chocolate cake halvah.
          </p>
        </section>
        <section>
          <h3>Cotton candy</h3>
          <p>
            Biscuit sugar plum cake sugar plum powder cookie halvah. Cotton candy muffin jelly-o chocolate liquorice marshmallow danish wafer cotton candy. Cake shortbread oat cake powder marshmallow.
          </p>
        </section>
      </article>
    </main>

    <footer class="landmark">
      <p>
        Created and maintained by
        <a href="#">Lene</a>
      </p>
      <nav>
        <ul role='list'>
          <li>
            <a href="#" class="link-rss">RSS Feed</a>
          </li>
          <li> <a href="#" class="link-rss">Follow</a>
          </li>
        </ul>
      </nav>
      <p>
        Crafted with semantic HTML.
      </p>
    </footer>

  </div>
</body>
              
            
!

CSS

              
                /* reset: https://andy-bell.co.uk/a-more-modern-css-reset/ */

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin-block-end: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: 1.5;
}

/* Set shorter line heights on headings and interactive elements */
h1,
h2,
h3,
h4,
button,
input,
label {
  line-height: 1.1;
}

/* Balance text wrapping on headings */
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* general */

body {
  font-size: clamp(1rem, 0.82rem + 0.88vw, 1.875rem);
}

.wrapper {
  --wrapper-size: clamp(16rem, 93vw, 120rem);
  inline-size: var(--wrapper-size);
  margin-inline: auto;
  position: relative;
}

svg {
  block-size: 2ex;
}

ul {
  display: flex;
  gap: 1rem;
  padding: 0;
}

/* main grid */

body > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

/* subgrids */

:is(header, main, footer).landmark,
main.landmark > article,
div.placeholder {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
}

/* creating lines with pseudo-elements and empty elements */


div.placeholder {
  --padding: 0;
  padding: var(--padding);
}



div.placeholder > *::before,
div.placeholder::after {
  content: '';
  position: absolute;
  inset-block: 0;
  border-inline-start:
    2px dashed
    blue;
}

div.placeholder::after {
  right: 0;
}


/* placeholder children */
div.placeholder > div:first-of-type {
  grid-column-start: 1;
}

div.placeholder > div:nth-of-type(2) {
  grid-column-start: 2;
}

div.placeholder > *:nth-of-type(3) {
  grid-column-start: 3;
}

div.placeholder > *:last-of-type {
  grid-column-start: 4;
}

/* placing items */

header.landmark svg {
  grid-column-start: -1;
}

article > *,
footer.landmark > * {
  grid-column: 1 / -1;
}

@media screen and (min-width: 36rem) {
  main.landmark > article > h2,
  main.landmark > article > p {
    grid-column: 1 / 2;
  }

  main.landmark > article > p {
    grid-row: 2;
  }

  article.chocolate > section:first-of-type {
    grid-column: 2 / -1;
    grid-row: 3;
  }

  article.chocolate > section:nth-of-type(2) {
    grid-column: 3 / -1;
    grid-row: 4;
  }

  article.chocolate > section:nth-of-type(3) {
    grid-column: span 1 / -1;
    grid-row: 5;
  }

  article.chocolate > section:last-of-type {
    grid-column: 3 / -1;
    grid-row: 6;
  }

  footer.landmark {
    grid-template-rows: repeat(2, auto);
  }

  footer.landmark p:first-of-type {
    grid-column: span 2;
    grid-row: 1 / -1;
  }

  footer.landmark p:last-of-type,
  footer.landmark nav {
    grid-column: span 2 / -1;
    place-self: end;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console