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 class="calendar">
  <div class="day one"></div>
  <div class="day two"></div>
  <div class="day three"></div>
  <div class="day four"></div>
  <div class="day five"></div>
  <div class="day six"></div>
  <div class="day seven"></div>
  <div class="tall-window">plants</div>
  <div class="day eight"></div>
  <div class="day nine"></div>
  <div class="day ten"></div>
  <div class="day eleven"></div>
  <div class="day twelve"></div>
  <div class="day thirteen"></div>
  <div class="day fourteen"></div>
  <div class="day fifteen"></div>
  <div class="day sixteen"></div>
  <div class="day seventeen"></div>
  <div class="day eighteen"></div>
  <div class="day nineteen"></div>
  <div class="day twenty"></div>
  <div class="day twentyone"></div>
  <div class="day twentytwo"></div>
  <div class="day twentythree"></div>
  <div class="day twentyfour"></div>
  <div class="day twentyfive"></div>
  <div class="day twentysix"></div>
  <div class="day twentysevent"></div>
  <div class="day twentyeight"></div>
  <div class="day twentynine"></div>
  <div class="day thirty"></div>
  <div class="day thirtyone"></div>
</main>
              
            
!

CSS

              
                @use postcss-nested;

.calendar {
  --_card-size: calc(50% - 80px); 
  --_windows: 2;
  
  inline-size: min(80vw, 1200px);
  border: 5px solid black;
  position: relative;
  background: hsl(0 0% 90%);
  
  display: grid;
  grid-template-columns: repeat(var(--_windows), minmax(var(--_card-size), 1fr));  
  grid-auto-flow: dense;
  gap: 40px;
  padding: 40px;
  align-items: start;
  
  counter-reset: calendar;
  
  @media (min-width: 480px) {
    --_card-size: calc(33% - 80px);
    --_windows: 3;
  }
  
  @media (min-width: 720px) {
    --_card-size: calc(25% - 80px);
    --_windows: 4;
  }
  
  &::before {
    content: "";
    position: absolute;
    top: -30px;
    left: -5%;
    block-size: 20px;
    width: 110%;
    border: 5px solid black;
  }
  
  &::after {
    content: "";
    position: absolute;
    top: -60px;
    left: -10%;
    block-size: 25px;
    width: 120%;
    border: 5px solid black;
  }
}

.day {
  padding: 20px;
  box-shadow: 0 0 0 5px black;
  background: white;
  background-size: cover;
  background-position: center;
  min-block-size: 100%;
  position: relative;
  
  &::before {
    counter-increment: calendar;
    content: counter(calendar);
    
    position: absolute;
    bottom: -2ch;
    left: calc(50% - 2ch);
    
    background: white;
    display: grid;
    place-content: center;
    inline-size: 3ch;
    block-size: 3ch;
    border-radius: 1e3px;
    border: 3px solid black;
    font-size: .7rem;
  }
}

.one {
  border-radius: 1e2px 1e2px 0 0;
  background-image: url(https://doodleipsum.com/700x700/outline?1);
}

.two {
  aspect-ratio: 1;
  min-block-size: auto;
  align-self: center;
  background-image: url(https://doodleipsum.com/700x700/outline?2);
}

.three {
  border-radius: 1e2px;
  aspect-ratio: 1;
  min-block-size: auto;
  align-self: end;
  background-image: url(https://doodleipsum.com/700x700/outline?3);
}

.four {
  grid-row: span 2;
  background-image: url(https://doodleipsum.com/350x700/outline?4);
}

.five {
  aspect-ratio: 3/4;
  min-block-size: auto;
  align-self: center;
  background-image: url(https://doodleipsum.com/700x700/outline?5);
}

.six {
  border-radius: 20px 0 0;
  grid-column: span 2;
  background-image: url(https://doodleipsum.com/1400x700/outline?6);
}

.seven {
  background-image: url(https://doodleipsum.com/350x700/outline?7);
}

.eight {
  border-radius: 1e2px;
  aspect-ratio: 1;
  min-block-size: auto;
  align-self: end;
  background-image: url(https://doodleipsum.com/350x700/outline?8);
}

.nine {
  background-image: url(https://doodleipsum.com/350x700/outline?9);
}

.tall-window {
  grid-row: span 2;
  padding: 20px;
  box-shadow: 0 0 0 5px black;
  min-block-size: 100%;
}

.ten {
  background-image: url(https://doodleipsum.com/350x700/outline?10);
}

.eleven {
  border-radius: 1e2px;
  aspect-ratio: 1;
  min-block-size: auto;
  align-self: end;
  background-image: url(https://doodleipsum.com/350x700/outline?11);
}

* {
  box-sizing: border-box;
  margin: 0;
}

html {
  block-size: 100%;
}

body {
  min-block-size: 100%;
  font-family: system-ui, sans-serif;
  display: grid;
  place-content: center;
  padding-block-start: 20vh;
}
              
            
!

JS

              
                
              
            
!
999px

Console